Implement database access (incomplete)