public Element handle(FreeColServer server, Player player,
                          Connection connection) {
        Game game = server.getGame();
        ServerPlayer serverPlayer = server.getPlayer(connection);

        Unit unit;
        try {
            unit = player.getFreeColGameObject(builderId, Unit.class);
        } catch (Exception e) {
            return DOMMessage.clientError(e.getMessage());
        }
        if (!unit.canBuildColony()) {
            return DOMMessage.clientError("Unit " + builderId
                + " can not build colony.");
        }

        if (colonyName == null) {
            return DOMMessage.clientError("Null colony name");
        } else if (Player.ASSIGN_SETTLEMENT_NAME.equals(colonyName)) {
            ; // ok
        } else if (game.getSettlement(colonyName) != null) {
            return DOMMessage.clientError("Non-unique colony name "
                + colonyName);
        }

        Tile tile = unit.getTile();
        if (!player.canClaimToFoundSettlement(tile)) {
            return DOMMessage.clientError("Can not build colony on tile: "
                + tile);
        }

        // Build can proceed.
        return server.getInGameController()
            .buildSettlement(serverPlayer, unit, colonyName);
    }