don't loop the docs in doc-api when it's not neccesary
Abstract redis-connection away from the docdb and userdb into db.js