Finished up incomplete functions
Defined database schema