class DeprovisionApiHandler implements Callable<FullHttpResponse> {

    @Override
    public FullHttpResponse call() throws Exception {
    	LoggingService.logDebug(MODULE_NAME, "Start deprovison Api Handler http request");
        if (!ApiHandlerHelpers.validateMethod(this.req, DELETE)) {
            LoggingService.logError(MODULE_NAME, "Request method not allowed", 
            		new AgentUserException("Request method not allowed"));
            return ApiHandlerHelpers.methodNotAllowedResponse();
        }

        if (!ApiHandlerHelpers.validateAccessToken(this.req)) {
            String errorMsg = "Incorrect access token";
            outputBuffer.writeBytes(errorMsg.getBytes(UTF_8));
            LoggingService.logError(MODULE_NAME, errorMsg, new AgentUserException(errorMsg));
            return ApiHandlerHelpers.unauthorizedResponse(outputBuffer, errorMsg);
        }

        try {
            String status = FieldAgent.getInstance().deProvision(false);

            ObjectMapper objectMapper = new ObjectMapper();
            Map<String, String> resultMap = new HashMap<String, String>() {{
                put("message", status.replaceAll("\n", ""));
                put("status", status.contains("Success") ? "success" : "failed");
            }};

            String jsonResult = objectMapper.writeValueAsString(resultMap);
            FullHttpResponse res;
            if (resultMap.get("status").equals("failed")) {
                res = ApiHandlerHelpers.internalServerErrorResponse(outputBuffer, jsonResult);
            } else {
                res = ApiHandlerHelpers.successResponse(outputBuffer, jsonResult);
            }
            res.headers().set(HttpHeaderNames.CONTENT_TYPE, "application/json");
            LoggingService.logDebug(MODULE_NAME, "Finished status Api Handler http request");
            return res;
        } catch (Exception e) {
            String errorMsg = "Log message parsing error, " + e.getMessage();
            LoggingService.logError(MODULE_NAME, errorMsg, e);
            return ApiHandlerHelpers.badRequestResponse(outputBuffer, errorMsg);
        }
    }

    public  DeprovisionApiHandler(HttpRequest request, ByteBuf outputBuffer, byte[] content);

}