public IHttpActionResult Get(int id) { try { var timetable = _timetableService.GetById(id); var result = new JavaScriptSerializer().Serialize(timetable); return(this.JsonString(result)); } catch (Exception) { var message = ""; return(this.JsonString(message, HttpStatusCode.BadRequest)); } }