       return request->send( response );
     }
 
-    else if ( request->hasArg( "tftbrightness" ) )
-    {
-      if ( !xTftTaskHandle )
-      {
-        return request->send( 501, HEADER_HTML, NOT_PRESENT_ERROR_501 );
-      }
+    else if ( request->hasArg( "tftbrightness" ) ) {
+      if ( !xTftTaskHandle ) { return request->send( 501, HEADER_HTML, NOT_PRESENT_ERROR_501 ); }
       AsyncResponseStream *response = request->beginResponseStream( HEADER_HTML );
       response->printf( "%.2f", tftBrightness );
       return request->send( response );
     }
 
-    else if ( request->hasArg( "tftorientation" ) )
-    {
-      if ( !xTftTaskHandle )
-      {
-        return request->send( 501, HEADER_HTML, NOT_PRESENT_ERROR_501 );
-      }
+    else if ( request->hasArg( "tftorientation" ) ) {
+      if ( !xTftTaskHandle ) { return request->send( 501, HEADER_HTML, NOT_PRESENT_ERROR_501 ); }
       return request->send( 200, HEADER_HTML, ( tftOrientation == TFT_ORIENTATION_NORMAL ) ? "normal" : "upsidedown" );
     }
 
-    else if ( request->hasArg( "timezone" ) )
-    {
+    else if ( request->hasArg( "timezone" ) ) {
       AsyncResponseStream *response = request->beginResponseStream( HEADER_HTML );
       response->printf( "%s", getenv( "TZ" ) );
       return request->send( response );
     }
 
-    else if ( request->hasArg( "version" ) )
-    {
+    else if ( request->hasArg( "version" ) ) {
       return request->send( 200, HEADER_HTML, sketchVersion );
     }
 
-    else if ( request->hasArg( "wifissid" ) )
-    {
+    else if ( request->hasArg( "wifissid" ) ) {
       return request->send( 200, HEADER_HTML, WiFi.SSID().c_str() );
     }
 
-    else
-    {
+    else {
       return request->send( 400, HEADER_HTML, "Invalid option" );
     }
   });
 
-  server.on( "/api/setchannel", HTTP_POST, []( AsyncWebServerRequest * request )
-  {
-    if ( !request->authenticate( WWW_USERNAME, preferences.getString( PASSWD_KEY_NVS, WWW_DEFAULT_PASSWD ).c_str() ) )
-    {
+  server.on( "/api/setchannel", HTTP_POST, []( AsyncWebServerRequest * request ) {
+    if ( !request->authenticate( WWW_USERNAME, preferences.getString( PASSWD_KEY_NVS, WWW_DEFAULT_PASSWD ).c_str() ) ) {
       return request->requestAuthentication();
     }
     uint8_t channelNumber;
     char   nvsKeyname[16];
     channelNumber = checkChannelNumber( request);
-    if ( channelNumber == INVALID_CHANNEL )
-    {
+    if ( channelNumber == INVALID_CHANNEL ) {
       return request->send( 400, HEADER_HTML, "Invalid channel" );
     }
-    if ( request->hasArg( "color" ) )
-    {
-      for ( uint8_t currentChar = 0; currentChar < request->arg( "color" ).length(); currentChar++ )
-      {
-        if ( !isxdigit( request->arg( "color" )[currentChar] ) )
-        {
+    if ( request->hasArg( "color" ) ) {
+      for ( uint8_t currentChar = 0; currentChar < request->arg( "color" ).length(); currentChar++ ) {
+        if ( !isxdigit( request->arg( "color" )[currentChar] ) ) {
           return request->send( 400, HEADER_HTML, "Invalid char" );
         }
       }

      return request->send( 200, HEADER_HTML, preferences.getString( "oledorientation" ) );
    }

    else if ( request->hasArg( "password" ) )
    {
      //TODO:check password is valid
      if ( request->arg( "password") == "" )
      {
        return request->send( 400, HEADER_HTML, "Supply a password. Password not changed." );
      }
      //some more tests...

  static AsyncWebServer server(80);

  while ( !systemStart.tv_sec )
    delay(100);

  static char date[30];

  strftime( date, sizeof( date ), "%a, %d %b %Y %X GMT", gmtime( &systemStart.tv_sec ) );

  server.on( "/robots.txt", HTTP_GET, []( AsyncWebServerRequest * request ) {
    request->send( 200, HEADER_HTML, "User-agent: *\nDisallow: /\n" );
  });

  server.on( "/api/login", HTTP_POST, []( AsyncWebServerRequest * request ) {
    if ( !request->authenticate( WWW_USERNAME, preferences.getString( PASSWD_KEY_NVS, WWW_DEFAULT_PASSWD ).c_str() ) ) {
      return request->requestAuthentication();
    }
    request->send( 200 );
  });

  server.on( "/", HTTP_GET, [] ( AsyncWebServerRequest * request ) {
    if ( htmlUnmodified( request, date ) ) return request->send(304);
    AsyncWebServerResponse *response = request->beginResponse_P( 200, HEADER_HTML, index_htm, index_htm_len );
    response->addHeader( HEADER_LASTMODIFIED, date );
