refactored creating URI for exporting document, with better use of URI
api