Fix database config typos and create db_repository