hacky fix for #260. Document creation would succeed, but the client would pop-up an error message. This was because somehow the JSON got wrapped up in an HTML <pre> tag.