Fixed issue #1438 about returing of JSON on POST /document