Return string results in JSON format, if such a format is requested.