add direct db access to rpc - temporary hack!