public IHttpActionResult Put([FromBody] Species species) { IHttpActionResult result; if (species != null) { repository.Insert(species); result = StatusCode(HttpStatusCode.Created); } else { result = StatusCode(HttpStatusCode.BadRequest); } return(result); }