Fixed import error and cleaned up database loading "api"