protected function callApiMethod($name, $arguments)
    {
        $beforeMethod = 'before' . ucfirst($name);
        $afterMethod = 'after' . ucfirst($name);
        $options = isset($arguments[0]) ? $arguments[0] : [];

        if(method_exists($this, $beforeMethod)) {
            call_user_func_array([$this, $beforeMethod], $arguments);
        }
        $result = $this->post($this->apiMethods[$name], $this->createOptionResolver($name)->resolve($options));
        if(method_exists($this, $afterMethod)) {
            $result = call_user_func_array([$this, $afterMethod], array_merge([$result], $arguments));
        }

        return $result;
    }