public ActionResult <object> Post([FromBody] TeamsViewModel user) { if (user == null) { var toSerialize = new MessageHelpers <TeamsViewModel>() { Status = 404, Data = null }; return(JsonConvert.SerializeObject(toSerialize)); } else { try { var id = _teamsService.Add(user); var toSerialize = new MessageHelpers <TeamsViewModel>() { Status = 200, Data = null }; return(JsonConvert.SerializeObject(toSerialize)); } catch { var toSerialize = new MessageHelpers <TeamsViewModel>() { Status = 502, Data = null }; return(JsonConvert.SerializeObject(toSerialize)); } } }