public HttpResponseMessage Get(Guid id) { try { var entity = SourceData.GetEntityById(id); if (entity == null) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "No Entity With That Id" + id.ToString() + "found")); } else { return(Request.CreateResponse(HttpStatusCode.OK, entity)); } } catch (Exception ex) { Logger.Fatal("getEntityById function in EntityController" + ex.InnerException); return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Error")); } }