Defined latest group and building db functions and implemented db.py to the routes.