class ServerAPIHelper {
    private static final Logger LOG = LoggerFactory.getLogger(ServerAPIHelper.class);
    public static final String CHECK_USER_ONLINE_REQUEST = "check_user_online";
    public static final String KICKOFF_USER_REQUEST = "kickoff_user";

    private static Server server;
    public static ConcurrentHashMap<Integer, RequestInfo> requestMap = new ConcurrentHashMap<>();
    private static AtomicInteger aiRequestId = new AtomicInteger(1);
    public static ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2);

    public static void init(Server s) {
        server = s;
    }

    public interface Callback {
        void onSuccess(byte[] response);
        void onError(ErrorCode errorCode);
        void onTimeout();
        Executor getResponseExecutor();
    }

    public static void sendRequest(String fromUser, String clientId, String request, byte[] message, Callback callback, ProtoConstants.RequestSourceType requestSourceType) {<FILL_FUNCTION_BODY>}

    public static void sendResponse(int errorCode, byte[] message, String toUuid, int requestId) {
        LOG.debug("send async reponse to {} with requestId {}", toUuid, requestId);
        if (requestId > 0) {
            RequestInfo info = requestMap.remove(requestId);
            LOG.debug("receive async reponse requestId {}, errorCode {}", requestId, errorCode);
            if(info != null) {
                info.future.cancel(true);
                if (info.callback != null) {
                    info.callback.getResponseExecutor().execute(() -> {
                        if (errorCode == 0 || errorCode == ErrorCode.ERROR_CODE_SUCCESS_GZIPED.getCode()) {
                            info.callback.onSuccess(message);
                        } else {
                            info.callback.onError(ErrorCode.fromCode(errorCode));
                        }
                    });
                } else {

                }
            }
        }
    }
}

        int requestId = 0;

        if (callback != null) {
            requestId = aiRequestId.incrementAndGet();
            if (requestId == Integer.MAX_VALUE) {
                if(!aiRequestId.compareAndSet(Integer.MAX_VALUE, 1)) {
                    requestId = aiRequestId.incrementAndGet();
                }
            }
            requestMap.put(requestId, new RequestInfo(fromUser, clientId, callback, message, requestId, request));
        }

        server.onApiMessage(fromUser, clientId, message, requestId, "", request, requestSourceType);
    
<no_super_class>