private function extractError($response)
    {
        $error = array();
        $response = json_decode($response);
        if (property_exists($response, 'error')) {
            if (is_string($response->error->message)) {
                $message = $response->error->message;
            } elseif (is_object($response->error->message)) {
                $message = $response->error->message->value;
            } else {
                $message = "Unknown error";
            }
            $error['Message'] = $message;
            return $error;
        }
        return null;
    }