def jsonify(obj)
      case obj
      when String
        JSON.pretty_generate(JSON.parse(obj))
      when Hash, Array
        JSON.pretty_generate(obj)
      else
        obj.to_s
      end
    rescue Exception
      obj.to_s
    end
def jsonify(obj)
      case obj
      when String
        JSON.pretty_generate(JSON.parse(obj))
      when Hash, Array
        JSON.pretty_generate(obj)
      else
        obj.to_s
      end
    rescue Exception
      obj.to_s
    end
always returns a string, intended for request bodies
 every attempt is made to ensure string is valid json
 but if that is not possible, then its returned as is