public IActionResult DeleteMemeById([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { _memeService.Delete(id); return(Ok()); } catch (AppException ex) { // return error message if there was an exception return(BadRequest(new { message = ex.Message })); } }