Updated server code to update team list when changing the team on client-side