public IHttpActionResult GetRankedTeams(int leagueId, int teamId) { League league = db.Leagues.Find(leagueId); if (league == null) { return(NotFound()); } Team team = db.Teams.Find(teamId); if (team == null) { return(NotFound()); } int?seasonId = league.SeasonId; var resTeams = TeamsService.GetRankedTeams(leagueId, teamId, seasonId); return(Ok(resTeams)); }