 typedef struct {
     String identifier;
     float value;
-    String databaseId;
+    int databaseId;
 } Sensor;
 
 // This is for the ESP8266 processor on ESP-01

/*
 * Register device at server
 */
boolean registerDevice(){
    Serial.println(generateRegister(ip, identifier));
    String response = httpRequestPost(server + "/register", generateRegister(ip, identifier));

    if(response != HTTP_ERROR_RESPONSE && !errorInResponse(response)){
        // Set the databaseid's for the sensors
        StaticJsonBuffer<200> jsonBuffer;
        JsonObject& root = jsonBuffer.parseObject(response);

        if(root.success() && root.containsKey("found")){
            int index;

            Serial.println("REGISTER:\n" + response);

            char buffer[256];
            root["found"].printTo(buffer);
            JsonArray& jsonArray = jsonBuffer.parseArray(buffer);

            for(index = 0; index < MAX_SENSOR_COUNT; index++){
                const char* jsonId = jsonArray[index]["ID"];
                sensorsList[index].databaseId = jsonId;
            }

            return true;
        }
    }
    delay(1000);
    return registerDevice();   //retry recursive
}

/*

String generateRegister(String ip, String identifier){
    int index;

    StaticJsonBuffer<400> jsonBuffer;
    JsonObject& root = jsonBuffer.createObject();

    JsonArray& sensors = root.createNestedArray("sensors");
    for(index = 0; index < MAX_SENSOR_COUNT; index++){
        sensors.add(sensorsList[index].identifier);
    }

    root["sensors"] = sensors;
    root["ip"] = ip;

    char buffer[256];
    root.printTo(buffer);

    return buffer;
}

/*
 * Check if response is valid and no errors are returned (like device blocked)
 */
boolean errorInResponse(String response){
  StaticJsonBuffer<400> jsonBuffer;
  JsonObject& root = jsonBuffer.parseObject(response);
  if (!root.success()){
    return true;
