documents: fix bug in folder route
extend router by returning response object, support for the HEAD request method and the ability to render an empty response
add changes from master