Added initial multiple buckets support
added db to api