write functions for database queries
make progress on db setup