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