public IHttpActionResult PostGrade(Grade grade) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Grade createdGrade = gradesService.InsertGrade(grade); return(CreatedAtRoute("PostGrade", new { id = grade.Id }, createdGrade)); }