Almost done with the database interface