Add Database APIs and make a vain attempt to organize