def fetch(resource, params = {})
      method = :get
      page = 1

      params[:page] = page
      partial = request(resource, method, params)
      while partial.is_a?(Array) && !partial.empty?
        results ||= []
        results += partial
        page += 1
        params[:page] = page
        partial = request(resource, method, params)
      end

      results = partial unless partial.nil? || partial.empty?
      results
    end
def fetch(resource, params = {})
      method = :get
      page = 1

      params[:page] = page
      partial = request(resource, method, params)
      while partial.is_a?(Array) && !partial.empty?
        results ||= []
        results += partial
        page += 1
        params[:page] = page
        partial = request(resource, method, params)
      end

      results = partial unless partial.nil? || partial.empty?
      results
    end
fetch all pages of results