Implemented database api for teams