Support pretty-print of JSON via HTTP API

Spot-check unit tests added.