Generalize the database not the service
Fix compile errors
fix more compile errors