         server.send(statusCode, "application/json", content);
     });
   } else if (webtype == 0) {
+    Serial.println("");
+    Serial.println("webtype 0 selected");
     server.on("/", []() {
       IPAddress ip = WiFi.localIP();
       String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);

  Serial.println(WiFi.softAPIP());
  createWebServer(webtype);
  // Start the server
  server.begin();
  Serial.println("Server started"); 
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
void setupAP(void) {
  client.disconnect();
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);
  pinMode(0, INPUT);
  delay(1000);
  reconnect();}
  
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
void loop() {

  if (!client.connected() && (WiFi.status() == WL_CONNECTED)) {
    Serial.println("rwwwiaiau");
    reconnect();
  }
 
  
  client.subscribe("inTopic");
  client.loop();
  
   if (digitalRead(0)==false)
  {
    Serial.println("button pressed");
    delay(250);
     if (digitalRead(0)==false)joinControlNet();
    
  }

   
}
