code: def call_application_api(
      self, method_name: str = None, params: dict = None
  ) -> pd.DataFrame:
      # This will implement api base on the native query
      # By processing native query to convert it to api callable parameters
      if method_name not in ["hourly", "daily"]:
          raise NotImplementedError(
              f"Method {method_name} is not implemented"
          )
  
      if "latitude" not in params or "longitude" not in params:
          raise ValueError("Latitude and longitude are required")
  
      opt_params = {
          "exclude": "currently,minutely,alerts,hourly,daily".replace(
              "," + method_name, ""
          ),
          "units": params.get("units"),
      }
  
      # Build the query
      query = self.query_string_template.format(
          api_key=self._api_key,
          latitude=params["latitude"],
          longitude=params["longitude"],
      )
      if "time" in params:
          query += f",{params['time']}"
      # Add optional parameters
      query += "?" + "&".join(
          [f"{k}={v}" for k, v in opt_params.items() if v]
      )
  
      # Call the API
      response = requests.get(query)
      response.raise_for_status()
  
      # Parse the response
      data = response.json()
      if method_name not in data:
          raise ValueError(
              f"API response did not contain {method_name} data. Check your API key. Got response: {data}"
          )
  
      # Convert to dataframe
      df = pd.DataFrame(data[method_name]["data"]).assign(
          latitude=params["latitude"],
          longitude=params["longitude"],
          timezone=data["timezone"],
          offset=data["offset"],
      )
      df["localtime"] = pd.to_datetime(
          df["time"], utc=True, unit="s"
      ).dt.tz_convert(data["timezone"])
      df.drop(columns="time", inplace=True)
      return df
  
imports: import os
  from collections import OrderedDict
  from typing import Any
  import pandas
  import requests
  from mindsdb_sql import parse_sql
  from mindsdb_sql.parser import ast
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from mindsdb.integrations.handlers.utilities.query_utilities import SELECTQueryParser, SELECTQueryExecutor
  from mindsdb.integrations.libs.api_handler import APIHandler, APITable
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import HandlerResponse, HandlerStatusResponse
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.utilities.config import Config
label_desc: Use image node_id 6 for calling the PirateWeatherAPIHandler obj's underlying member method code with example usage: obj.call_application_api(method_name, params) and returns: df