public function createProject($writerId, $name = null, $accessToken = null, $queue = 'primary')
    {
        $job = $this->createProjectAsync($writerId, $name, $accessToken, $queue);
        if (!isset($job['url'])) {
            throw new ServerException('Create project job returned unexpected result: ' . json_encode($job, JSON_PRETTY_PRINT));
        }

        $result = $this->waitForJob($job['url']);
        if (!isset($result['result'][0]['pid'])) {
            throw new ServerException('Job info for create project returned unexpected result: ' . json_encode($result, JSON_PRETTY_PRINT));
        }

        return ['pid' => $result['result'][0]['pid']];
    }