def filter_result(json_response)
      result = JSON[json_response] rescue []
      result = [result] unless result.is_a? Array
      result.map! { |r| r.select! { |k, _v| selected_fields.any? { |f| f.match k } } } unless selected_fields.empty?
      result
    end
def filter_result(json_response)
      result = JSON[json_response] rescue []
      result = [result] unless result.is_a? Array
      result.map! { |r| r.select! { |k, _v| selected_fields.any? { |f| f.match k } } } unless selected_fields.empty?
      result
    end
Parses the json_response, wraps it in an array if needed and filters the
 fields based on the selected_fields