Update dbapi.py

fix 2 functions