Create getTeam function in application_controller