public IHttpActionResult CompanyAdd([FromBody] Company company) { if (company == null) { return(BuildResponse("Company data not provided for saving.", ResponseTypes.BadRequest)); } try { DataWriter db = new DataWriter(_inTestMode); int result = db.AddCompany(company); return(Ok(result)); } catch (Exception ex) { return(BuildResponse("Error while saving the company.", ResponseTypes.BadRequest, ex)); } }