public HttpResponseMessage ConfirmSponsorship(HttpRequestMessage request, int studentId, int sponsorshipId, string confirmationMessage) { HttpResponseMessage response = null; if (ModelState.IsValid) { var confirmed = _studentApi.ConfirmSponsorship(studentId, sponsorshipId, confirmationMessage); if (confirmed) { response = request.CreateResponse(HttpStatusCode.OK, new { success = true }); } else { response = request.CreateResponse(HttpStatusCode.OK, new { success = false }); } } return(response); }