implement database wrapper to use original api
fixed bug in connect
fixed another bug in conner
work on connect scope problem
another attempt to fix connect problem