Add support for downloading the document from couchdb