public HttpResponseMessage DeleteKPIEntry(HttpRequestMessage request, [FromBody] int kpiEntryId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SCDKPIEntry kpiEntry = _ScorecardService.GetSCDKPIEntry(kpiEntryId); if (kpiEntry != null) { _ScorecardService.DeleteSCDKPIEntry(kpiEntryId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No kpiEntry found under that ID."); } return response; })); }