Clean up API calls; app.py for qmail; remaining db funcs.
Fix.