public function getErrorData($key = null)
    {
        if ($this->isSuccessful()) {
            return null;
        }
        // get error data (array in data)
        $data = isset($this->getData('data')[0]) ? $this->getData('data')[0] : null;
        if ($key) {
            return isset($data[$key]) ? $data[$key] : null;
        }
        return $data;
    }