Test code for DB calls

this needs to be changed to support directives