public JsonResult GetAll(string token) { var user = _auth.Authenticate(token); if (user == null) { throw new TedExeption(ExceptionCodes.Authentication); } return(Json(new { success = true, data = _repo.GetAllForUser(user) })); }