@Override
    public void doGet(HttpServletRequest req, HttpServletResponse res)
            throws IOException {
        PrintWriter out = res.getWriter();
        UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();

        String deviceToken = req.getParameter("registerdevicetoken");
        if (deviceToken != null) {
            // This code simulates an iOS client calling an API
            // to register device token for push notification
            DeviceRegistration device = new DeviceRegistration();
            device.setDeviceToken(deviceToken);
            try {
              new DeviceRegistrationEndpoint().registerDevice(device, user);
            } catch (ServiceException e) {
              out.println("Device NOT registered: " + e.getMessage());
              return;
            }
            log.info("Admin registered a new device token");
            out.println("Device registered successfully");
        }

        String alert = req.getParameter("alert");
        if (alert != null) {
            // This code simulate an action of an admin that wants to send a
            // push notification to all devices
            PushNotificationUtility.enqueuePushAlertToAllDevices(alert);
            log.info("Admin enqueud push alert to all devices");
            out.println("Push alert sent to all devices");
        }

        String achievement = req.getParameter("achievement");
        if (achievement != null) {
            // This code simulates an iOS client calling an API that
            // among other things sends push notification
            try {
                new DummyGameEndpoint().achievementUnlocked(achievement, user);
                log.info("Admin called achievementUnlocked");
                out.println("Achievement unlocked processed successfully");
            } catch (ServiceException e) {
              out.println("Achievement request NOT processed: " + e.getMessage());
              return;
            }
        }
    }