public async Task <IHttpActionResult> Return(int?id) { try { Package package = Db.Packages.FirstOrDefault(p => p.Id == id); Validator validator = PackageValidator.Return(package); if (!validator.Success) { return(BadRequest(validator.ErrorMessage)); } package.Status = Status.Received; await Db.SaveChangesAsync(); return(Ok("Attempting delivery")); } catch { return(BadRequest("An error has occurred")); } }