public function api()
    {
        if (!$this->api) {
            // Get the domain and token
            $shopDomain = $this->shopify_domain;
            $token = $this->session()->getToken();

            // Create new API instance
            $this->api = ShopifyApp::api();
            $this->api->setSession($shopDomain, $token);
        }

        // Return existing instance
        return $this->api;
    }