public HttpResponseMessage DeleteExtraction(HttpRequestMessage request, [FromBody] int extractionId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data Extraction extraction = _ExtractionProcessService.GetExtraction(extractionId); if (extraction != null) { _ExtractionProcessService.DeleteExtraction(extractionId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No extraction found under that ID."); } return response; })); }