fixed db schema, added db interface to rb