public function addUserToProject($writerId, $pid, $email, $role = 'editor', $queue = 'primary')
    {
        $job = $this->addUserToProjectAsync($writerId, $pid, $email, $role, $queue);
        if (!isset($job['url'])) {
            throw new ServerException('Create project job returned unexpected result: ' . json_encode($job, JSON_PRETTY_PRINT));
        }

        return $this->waitForJob($job['url']);
    }