Fixed DB, Celery, Flask bugs, generation works somewhat; some db issues still exist