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

        Unit unit;
        try {
            unit = player.getFreeColGameObject(unitId, Unit.class);
        } catch (Exception e) {
            return DOMMessage.clientError(e.getMessage());
        }

        Tile tile = unit.getTile();
        if (tile == null) {
            return DOMMessage.clientError("Unit is not on the map: "
                + unitId);
        }

        Colony colony = tile.getColony();
        if (colony == null) {
            return DOMMessage.clientError("Unit is not at a colony: "
                + unitId);
        }

        WorkLocation workLocation
            = game.getFreeColGameObject(workLocationId, WorkLocation.class);
        if (workLocation == null) {
            return DOMMessage.clientError("Not a work location: "
                + workLocationId);
        } else if (workLocation.getColony() != colony) {
            return DOMMessage.clientError("Work location is not in the colony"
                + " where the unit is: " + workLocationId);
        } else if (!workLocation.canAdd(unit)) {
            return DOMMessage.clientError("Can not add " + unit.toString()
                + " to " + workLocation.toString()
                + ": " + workLocation.getNoAddReason(unit));
        }

        // Work.
        return server.getInGameController()
            .work(serverPlayer, unit, workLocation);
    }