Added basic db functionality