public HttpResponseMessage Delete(int id) { try { CommitRepository.Delete(id); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (ElementNotFoundException e) { return(Request.CreateResponse(HttpStatusCode.BadRequest, e.Message)); } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Generic error happened.")); } }