def handle_response(response)
      # Check our response code
      check_response_fail(response)
      return nil if blank?(response.body)

      # Return a bunch of mashes as the body if we're JSON
      begin
        response.body = JSON.parse(response.body, max_nesting: false)
        response.body = if response.body.is_a? Array
                        response.body.map { |r| Hashie::Mash.new(r) }
                      else
                        Hashie::Mash.new(response.body)
                      end
      rescue => exception
        raise "JSON parsing failed. Error details: #{exception}"
      ensure
        return response
      end
    end
def handle_response(response)
      # Check our response code
      check_response_fail(response)
      return nil if blank?(response.body)

      # Return a bunch of mashes as the body if we're JSON
      begin
        response.body = JSON.parse(response.body, max_nesting: false)
        response.body = if response.body.is_a? Array
                        response.body.map { |r| Hashie::Mash.new(r) }
                      else
                        Hashie::Mash.new(response.body)
                      end
      rescue => exception
        raise "JSON parsing failed. Error details: #{exception}"
      ensure
        return response
      end
    end
Returns a response with a parsed body