draft implementation of database wrapper