public IHttpActionResult Put([FromUri] int id, [FromBody] CocktailCreate model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (_service.GetByID(id) is null) { return(NotFound()); } if (!_service.IsLiquorInDatabase(model.LiquorsInCocktail)) { return(InternalServerError(new SystemException("Liquor is not in database."))); } if (_service.ChangesWereNotMade(id, model)) { return(Ok("No changes were made.")); } if (_service.DoesCocktailAlreadyExist(model)) { return(Conflict()); } if (!_service.UpdateByID(id, model)) { return(InternalServerError()); } return(Ok()); }