diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js
index d44b5cf..4c8f68c 100644
--- a/ui-react/src/api/LoopCache.js
+++ b/ui-react/src/api/LoopCache.js
@@ -21,15 +21,14 @@
  *
  */
 
-class LoopCache {
+export default class LoopCache {
 	loopJsonCache;
 
 	constructor(loopJson) {
 		this.loopJsonCache=loopJson;
-		//LoopCache.SET_LOOP_JSON_CACHE(require('./example.json');
 	}
 
-	updateMsProperties(type, newMsProperties) {
+	updateMicroServiceProperties(type, newMsProperties) {
 		if (newMsProperties["name"] === type) {
 			for (var policy in this.loopJsonCache["microServicePolicies"]) {
 				if (this.loopJsonCache["microServicePolicies"][policy]["name"] === type) {
@@ -43,7 +42,7 @@
 		this.loopJsonCache["globalPropertiesJson"] = newGlobalProperties;
 	}
 
-	updateOpPolicyProperties(newOpProperties) {
+	updateOperationalPolicyProperties(newOpProperties) {
 		this.loopJsonCache["operationalPolicies"] = newOpProperties;
 	}
 
@@ -51,7 +50,7 @@
 		return this.loopJsonCache["name"];
 	}
 
-	getOperationalPolicyProperty() {
+	getOperationalPolicyConfigurationJson() {
 		return JSON.parse(JSON.stringify(this.loopJsonCache["operationalPolicies"]["0"]["configurationsJson"]));
 	}
 
@@ -59,15 +58,15 @@
 		return JSON.parse(JSON.stringify(this.loopJsonCache["operationalPolicies"]));
 	}
 
-	getGlobalProperty() {
+	getGlobalProperties() {
 		return JSON.parse(JSON.stringify(this.loopJsonCache["globalPropertiesJson"]));
 	}
 
-	getDeploymentProperties() {
+	getDcaeDeploymentProperties() {
 		return JSON.parse(JSON.stringify(this.loopJsonCache["globalPropertiesJson"]["dcaeDeployParameters"]));
 	}
 
-	getMsJson(type) {
+	getMicroServicesJsonForType(type) {
 		var msProperties = this.loopJsonCache["microServicePolicies"];
 		for (var policy in msProperties) {
 			if (msProperties[policy]["name"] === type) {
@@ -77,7 +76,7 @@
 		return null;
 	}
 
-	getMsProperty(type) {
+	getMicroServiceProperties(type) {
 		var msProperties = this.loopJsonCache["microServicePolicies"];
 		for (var policy in msProperties) {
 			if (msProperties[policy]["name"] === type) {
@@ -89,7 +88,7 @@
 		return null;
 	}
 
-	getMsUI(type) {
+	getMicroServiceJsonRepresentationForType(type) {
 		var msProperties = this.loopJsonCache["microServicePolicies"];
 		for (var policy in msProperties) {
 			if (msProperties[policy]["name"] === type) {
@@ -114,16 +113,4 @@
 	getComponentStates() {
 		return this.loopJsonCache.components;
 	}
-
-	get getLoopJsonCache() {
-		return this.loopJsonCache;
-	}
-
-	set setLoopJsonCache(newJson) {
-		this.loopJsonCache = newJson;
-	}
 }
-
-export const LOOP_CACHE = new LoopCache(require('./example.json'));
-
-export default LoopCache;
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js
index f59f457..2813a7c 100644
--- a/ui-react/src/api/LoopService.js
+++ b/ui-react/src/api/LoopService.js
@@ -22,55 +22,62 @@
 
 export default class LoopService {
 	static getLoopNames() {
-		const url = '/restservices/clds/v2/loop/getAllNames';
-		const options = {
-			method: 'GET'
-		};
-		return fetch(url,options)
-		.then(function (response) {
-			if (response.ok) {
-				console.log("GetLoopNames response received: ", response.status);
-				return response.json();
-			} else {
-				let errorMsg = "GetLoopNames failed with status code: " + response.status;
-				console.error(errorMsg);
-				return Promise.reject(errorMsg);
-			}
-		})
-		.then(function (data) {
-			return data;
-		})
-		.catch(function(error) {
-			console.error("GetLoopNames error received",error);
-			return Promise.reject(error);
-		});
+		return fetch('/restservices/clds/v2/loop/getAllNames', { method: 'GET', credentials: 'include', })
+			.then(function (response) {
+				console.debug("GetLoopNames response received: ", response.status);
+				if (response.ok) {
+					return response.json();
+				} else {
+					console.error("GetLoopNames query failed");
+					return {};
+				}
+			})
+			.catch(function (error) {
+				console.error("GetLoopNames error received", error);
+				return {};
+			});
 	}
 
 	static getLoop(loopName) {
-		const url = '/restservices/clds/v2/loop/' + loopName;
-		const options = {
+		return fetch('/restservices/clds/v2/loop/' + loopName, {
 			method: 'GET',
 			headers: {
 				"Content-Type": "application/json"
-			}
-		};
-		return fetch(url,options)
-		.then(function (response) {
-			if (response.ok) {
-				console.log("GetLoop response received: ", response.status);
-				return response.json();
-			} else {
-				let errorMsg = "GetLoop failed with status code: " + response.status;
-				console.error(errorMsg);
-				return Promise.reject(errorMsg);
-			}
+			},
+			credentials: 'include',
 		})
-		.then(function (data) {
-			return data;
+			.then(function (response) {
+				console.debug("GetLoop response received: ", response.status);
+				if (response.ok) {
+					return response.json();
+				} else {
+					console.error("GetLoop query failed");
+					return {};
+				}
+			})
+			.catch(function (error) {
+				console.error("GetLoop error received", error);
+				return {};
+			});
+	}
+
+	static getSvg(loopName) {
+		return fetch('/restservices/clds/v2/loop/svgRepresentation/' + loopName, {
+			method: 'GET',
+			credentials: 'include',
 		})
-		.catch(function(error) {
-			console.error("GetLoop error received",error);
-			return Promise.reject(error);
-		});
+			.then(function (response) {
+				console.debug("svgRepresentation response received: ", response.status);
+				if (response.ok) {
+					return response.text();
+				} else {
+					console.error("svgRepresentation query failed");
+					return "";
+				}
+			})
+			.catch(function (error) {
+				console.error("svgRepresentation error received", error);
+				return "";
+			});
 	}
 }
diff --git a/ui-react/src/api/UserService.js b/ui-react/src/api/UserService.js
index 8145395..8f53d7b 100644
--- a/ui-react/src/api/UserService.js
+++ b/ui-react/src/api/UserService.js
@@ -22,28 +22,29 @@
  */
 
 export default class UserService {
-
-	static LOGIN() {
+	static notLoggedUserName='Anonymous';
+	static login() {
 		return fetch('/restservices/clds/v1/user/getUser', {
 				method: 'GET',
 				credentials: 'include',
 			})
 		.then(function (response) {
+			console.debug("getUser response received, status code:", response.status);
 			if (response.ok) {
-				console.log("getUser response received: ", response.status);
 				return response.text();
 			} else {
-				console.error("getUser failed with status code: ",response.status);
-				return "Anonymous";
+				console.error("getUser response is nok");
+				return UserService.notLoggedUserName;
 			}
 		})
 		.then(function (data) {
-			console.log ("User connected:",data)
+			console.info ("User connected:",data)
 			return data;
 		})
 		.catch(function(error) {
-			console.error("getUser error received",error);
-			return "Anonymous";
+			console.warn("getUser error received, user set to: ",UserService.notLoggedUserName);
+			console.error("getUser error:",error);
+			return UserService.notLoggedUserName;
 		});
 	}
 }
diff --git a/ui-react/src/api/example.json b/ui-react/src/api/example.json
index f3cc9e1..108cf78 100644
--- a/ui-react/src/api/example.json
+++ b/ui-react/src/api/example.json
@@ -1,5 +1,5 @@
 {
-  "name": "LOOP_h2NMX_v1_0_ResourceInstanceName1_tca",
+  "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
   "dcaeBlueprintId": "typeId-3a942643-a8f7-4e54-b2c1-eea8daba2b17",
   "globalPropertiesJson": {
     "dcaeDeployParameters": {
