Added more database functionality