Initial commit of basic db funcs