added support for returning raw json strings if desired