Fix bugs and add integration tests for API getTeamsByDivision: