database interface finished