improved database.py

okay moved schema to admin and setup routes for app