printf($jsonString);
    printf('Unable to parse JSON response, is it valid? %s', json_last_error_msg());
    die(1);
}
//initialize the client
$client = new Client($server);
$client->authentication('jsonrpc', $token);
//verify that we can connect
$projects = null;
try {
    $projects = $client->getAllProjects();
} catch (RuntimeException $e) {
    $projects = null;
    //explicitly set it to null, to trigger an error
}
$users = $client->getAllUsers();
foreach ($users as $user) {
    if ($user['username'] == $userId || $userId == null) {
        $userId = $user['id'];
    }
}
if (!is_array($projects)) {
    echo 'Unable to fetch the list of projects, is the server url / token correct?' . PHP_EOL;
    die(1);
}
//variables
$trelloLists = array();
$trelloLabels = array();
//we will store all label names, but not add them immediately, only when used
$trelloAttachments = array();
//create the project