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