 // false otherwise.
 bool checkAuthorization()
 {
-  String swipePath = createPath("swipe");
+  Serial.print("Checking for authorization of cardID: ");
+  Serial.println(UID);
+  String swipePath = "/spotsHW/swipe/1234/LB/0013/";
   // UID is a global variable that contains the integer representation of the card ID
   String cardID = String(UID);
-  swipePath = swipePath + cardID;
+  swipePath += cardID;
   const char * c;
-  int statusCode;
+  int statusCode = 0;
   int len;
+  String response = "";
   
   c = swipePath.c_str();
-  Serial.print("swipePath: ");
-  Serial.print(c);
-  Serial.println();
-  statusCode = client.post(c, "POSTDATA", &response);
-  Serial.print("Status code from server: ");
-  Serial.println(statusCode);
-  Serial.print("Response body from server: ");
-  Serial.println(response); 
-  delay(10);
+
+  statusCode = client.post(c, "POSTDATA", &response);  
+
+  if(statusCode == 200) {
+    success++;
+  }
+  else {
+    failure++;
+  }
+  Serial.print("Successful server requests: ");
+  Serial.println(success);
+  Serial.print("Failed requests:");
+  Serial.println(failure);
 
   // Search the response string for "true" to see if user is authorized
   len = response.length();
   for(int i = 0; i <= len; i++) {
-    if(response.substring(i, i + 4) == "true")
+    if(response.substring(i, i + 4) == "true") {
+      Serial.print("User is authorized. \n");
       return true;
+    }
   }
   // if we can't find "true" in the response string, user is not authorized...
+  Serial.print("User is unauthorized. \n");
   return false;
 }

  // Code to setup esp8266 to connect to zee weefee 
  delay(100);
  WiFi.begin(weefee_ID, weefee_Password);
  Serial.print("Connecting to ze network...");
  while (WiFi.status() != WL_CONNECTED) {
    //Serial.print(".");
    delay(500);
  }
  Serial.println();
  Serial.print("connected: ");
  Serial.println(WiFi.localIP());
}

// Reads the Unique ID from the card and stores it as a 32-bit unsigned integer

        flash = !flash;
        delay(250);   // Delay 250ms
      }
      digitalWrite(Red_Led, HIGH);
      // If the object, left exit the loop
      if(digitalRead(Sensor_Pin))
        break;               
    }
    get_UID();
    authorized = checkAuthorization();

    if(authorized == false)
    {
      bool flash = true; 
      while(authorized == false)
      {
        Serial.println("Please try scanning again or Please leave the spot.");
        while(!digitalRead(Sensor_Pin) && readCard())
        {
          digitalWrite(Red_Led, flash);
          flash = !flash;
          delay(250);
        }
        digitalWrite(Red_Led, HIGH);
        // If the object, left exit the loop
        if(digitalRead(Sensor_Pin))
          break;
        get_UID();
        authorized = checkAuthorization();   
//        delay(200);
//        break;
      }
    }
    if(authorized == true) {
      digitalWrite(Red_Led, LOW); // Shutoff Red LED for flashing sequence
      flash_LED(Green_Led, 2000); // Flash LED for 2 seconds
      digitalWrite(Red_Led, HIGH);  // Turn on RED LED to signal occupied
      Serial.print("Waiting for user to move their vehicle...\n");
      while(!digitalRead(Sensor_Pin))
      {
        delay(500); // check the pin every 500ms to avoid WDT reset
      }     
//      delay(200);
//      break; 
    }
  
  }
  if(vacancyFlag == true) {
    Serial.println("User has left the spot. Updating spot vacancy.");
    updateVacancy("true");
    Serial.println();
    Serial.println("Waiting for spot to become occupied...");
  }
  delay(100); // Check for card every 100ms to avoid WDT resets
}

////////////////////////////////////////////////////////////////////////////////////////////////
