Made Database class usable for AccountController

Improved Database class and made it useable for AccountController.