added more db functions to model.py