Adding database functionality to app