shorten: return JSON when asked for JSON

refs #2