private byte[] activateCrawler(HtmlRequest htmlRequest) throws IOException {

    byte[] bodyInBytes;
    String domain = htmlRequest.parametersInRequestBody.get("Domain");
    boolean ignoreRobots = false;
    boolean performPortScan = false;

    if (htmlRequest.parametersInRequestBody.containsKey("portscan")) {
      performPortScan = true;
    }
    if (htmlRequest.parametersInRequestBody.containsKey("robots.txt")) {
      ignoreRobots = true;
    }
    boolean isConfigureSucceeded =
        serverCrawler.ConfigureCrawler(domain, ignoreRobots, performPortScan);
    if (isConfigureSucceeded) {
      bodyInBytes = prepareDefaultPage("Crawler started succesfuly");
      System.out.println("Domain is: " + domain);
      System.out.println("Perform port scan: " + performPortScan);
      System.out.println("Ignore robots.txt: " + ignoreRobots);
    } else {
      bodyInBytes = prepareDefaultPage("Crawler is already running");
    }

    return bodyInBytes;
  }