Added database functionality. Need to hook it up to UI