public string InsertExam([FromBody] object value) { ResultObject resultt = new ResultObject(); try { if (value != null && value.ToString().Count() > 0) { var exam = JsonConvert.DeserializeObject <Exam>(value.ToString()); var result = services.Insert(exam); return(JsonConvert.SerializeObject(result)); } return("FALSE"); } catch (Exception e) { resultt.Message = "EXCEPTION: " + e.Message + "Stack: " + e.StackTrace; return(JsonConvert.SerializeObject(resultt)); } }