public IHttpActionResult GetItemByCatid(int catid) { string error = ""; List <ItemModel> im = ItemRepo.GetItemByCatid(catid, out error); if (error != "" || im == null) { if (error == ConError.Status.NOTFOUND) { return(Content(HttpStatusCode.NotFound, "Item Not Found")); } return(Content(HttpStatusCode.BadRequest, error)); } return(Ok(im)); }