building out db api