add schema

closes #16
Defined more db functions and implemented db.py to the routes.