issue #13 Database API

Tests fixed