API and database changes

Reformatted the some of the existing php files. Started work on the team
php file and made some formatting changes to database model.