protected function _mapFnToApiMethod($function, &$apiparams)
  {
    // replace _ by /
    $method = $this->_mapFnInsertSlashes($function);

    // undo replacement for URL parameters
    $method = $this->_mapFnRestoreParamUnderscores($method);

    // replace AA by URL parameters
    list ($method, $method_template) = $this->_mapFnInlineParams($method, $apiparams);

    if (substr($method, 0, 4) !== 'ton/') {
      // replace A-Z by _a-z
      for ($i = 0; $i < 26; $i++) {
        $method  = str_replace(chr(65 + $i), '_' . chr(97 + $i), $method);
        $method_template = str_replace(chr(65 + $i), '_' . chr(97 + $i), $method_template);
      }
    }

    return [$method, $method_template];
  }