private function executeRest($command, $parameters = array())
    {

        $result = $this->restClient->execute($command);

        if (isset($result['code']) && $result['code'] === 0) {
            return $result;
        }

        throw new Exception(
            "There was an error with the Rest call " .
            $command->getName() .
            PHP_EOL .
            $result['code'] .
            ' : ' .
            $result['message'] .
            PHP_EOL .
            print_r($result['errors'], true) .
            PHP_EOL .
            'Parameters : ' .
            print_r($parameters, true) .
            PHP_EOL,
            $result['code']
        );

    }