public object Delete(State deleted) { object json; try { bool result = repository.Remove(deleted); json = new { success = result }; } catch (Exception ex) { json = new { success = false, message = ex.Message }; } return(json); }