You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: api.rb
    path of file: ./repos/koala/lib/koala
    
    the code of the file until where you have to start completion: # graph_batch_api and legacy are required at the bottom, since they depend on API being defined
require 'koala/api/graph_api_methods'
require 'koala/api/graph_collection'
require 'openssl'

module Koala
  module Facebook
    class API
      # Creates a new API client.
      # @param [String] access_token access token
      # @param [String] app_secret app secret, for tying your access tokens to your app secret
      #                 If you provide an app secret, your requests will be
      #                 signed by default, unless you pass appsecret_proof:
      #                 false as an option to the API call. (See
      #                 https://developers.facebook.com/docs/graph-api/securing-requests/)
      # @param
    
      def api(path, args = {}, verb = "get", options = {})
        # we make a copy of args so the modifications (added access_token & appsecret_proof)
        # do not affect the received argument
        args = args.dup

        # If a access token is explicitly provided, use that
        # This is explicitly needed in batch requests so GraphCollection
        # results preserve any specific access tokens provided
        args["access_token"] ||= @access_token || @app_access_token if @access_token || @app_access_token

        if options.delete(:appsecret_proof) && args["access_token"] && @app_secret
          args["appsecret_proof"] = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha256"), @app_secret, args["access_token"])
        end

        # Translate any arrays in the params into comma-separated strings
        args = sanitize_request_parameters(args) unless preserve_form_arguments?(options)

        # add a leading / if needed...
        path = "/#{path}" unless path.to_s =~ /^\//

        # make the request via the provided service
        result = Koala.make_request(path, args, verb, options)

        if result.status.to_i >= 500
          raise Koala::Facebook::ServerError.new(result.status.to_i, result.body)
        end