XNAT-2673: Added check for response text so that "<pre></pre>" counts as no text: this is apparently what IE sees in an empty response body.
XNAT-2673: More fixes to deal with unintentional overwrite. Also changed response for duplicates to JSON with text/html content type to work around issue where application/json resulted in <pre> tags being put on the text.

xdat jars from changeset https://bitbucket.org/nrg/xdat_1_6dev/commits/1f434fd4056fd601c91b83ed4ed19a8f8e8e551b