refactor backend : use callbacks; retrieve teams from database