Added more methods to db.py