changes db.py to return connection instead of cursor so we can use with con to handle errors for us