diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js
index 4c8f68c..b854c7c 100644
--- a/ui-react/src/api/LoopCache.js
+++ b/ui-react/src/api/LoopCache.js
@@ -29,13 +29,11 @@
 	}
 
 	updateMicroServiceProperties(type, newMsProperties) {
-		if (newMsProperties["name"] === type) {
 			for (var policy in this.loopJsonCache["microServicePolicies"]) {
 				if (this.loopJsonCache["microServicePolicies"][policy]["name"] === type) {
-					this.loopJsonCache["microServicePolicies"][policy] = newMsProperties;
+					this.loopJsonCache["microServicePolicies"][policy]["properties"] = newMsProperties;
 				}
 			}
-		}
 	}
 
 	updateGlobalProperties(newGlobalProperties) {
@@ -51,49 +49,47 @@
 	}
 
 	getOperationalPolicyConfigurationJson() {
-		return JSON.parse(JSON.stringify(this.loopJsonCache["operationalPolicies"]["0"]["configurationsJson"]));
+		return this.loopJsonCache["operationalPolicies"]["0"]["configurationsJson"];
 	}
 
 	getOperationalPolicies() {
-		return JSON.parse(JSON.stringify(this.loopJsonCache["operationalPolicies"]));
+		return this.loopJsonCache["operationalPolicies"];
 	}
 
 	getGlobalProperties() {
-		return JSON.parse(JSON.stringify(this.loopJsonCache["globalPropertiesJson"]));
+		return this.loopJsonCache["globalPropertiesJson"];
 	}
 
 	getDcaeDeploymentProperties() {
-		return JSON.parse(JSON.stringify(this.loopJsonCache["globalPropertiesJson"]["dcaeDeployParameters"]));
+		return this.loopJsonCache["globalPropertiesJson"]["dcaeDeployParameters"];
 	}
 
-	getMicroServicesJsonForType(type) {
-		var msProperties = this.loopJsonCache["microServicePolicies"];
+	getMicroServicePolicies() {
+		return this.loopJsonCache["microServicePolicies"];
+	}
+
+	getMicroServiceForName(name) {
+		var msProperties=this.getMicroServicePolicies();
 		for (var policy in msProperties) {
-			if (msProperties[policy]["name"] === type) {
-				return JSON.parse(JSON.stringify(msProperties[policy]));
+			if (msProperties[policy]["name"] === name) {
+				return msProperties[policy];
 			}
 		}
 		return null;
 	}
 
-	getMicroServiceProperties(type) {
-		var msProperties = this.loopJsonCache["microServicePolicies"];
-		for (var policy in msProperties) {
-			if (msProperties[policy]["name"] === type) {
-				if (msProperties[policy]["properties"] !== null && msProperties[policy]["properties"] !== undefined) {
-					return JSON.parse(JSON.stringify(msProperties[policy]["properties"]));
-				}
-			}
+	getMicroServicePropertiesForName(name) {
+		var msConfig = this.getMicroServiceForName(name);
+		if (msConfig !== null) {
+			return msConfig["properties"];
 		}
 		return null;
 	}
 
-	getMicroServiceJsonRepresentationForType(type) {
-		var msProperties = this.loopJsonCache["microServicePolicies"];
-		for (var policy in msProperties) {
-			if (msProperties[policy]["name"] === type) {
-				return JSON.parse(JSON.stringify(msProperties[policy]["jsonRepresentation"]));
-			}
+	getMicroServiceJsonRepresentationForName(name) {
+		var msConfig = this.getMicroServiceForName(name);
+		if (msConfig !== null) {
+			return msConfig["jsonRepresentation"];
 		}
 		return null;
 	}
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js
index fa7cd2e..020a3bf 100644
--- a/ui-react/src/api/LoopService.js
+++ b/ui-react/src/api/LoopService.js
@@ -42,7 +42,7 @@
 		return fetch('/restservices/clds/v2/loop/' + loopName, {
 			method: 'GET',
 			headers: {
-				"Content-Type": "application/json"
+				"Content-Type": "application/json",
 			},
 			credentials: 'same-origin',
 		})
@@ -64,7 +64,7 @@
 	static getSvg(loopName) {
 		return fetch('/restservices/clds/v2/loop/svgRepresentation/' + loopName, {
 			method: 'GET',
-			credentials: 'same-origin',			
+			credentials: 'same-origin',
 		})
 			.then(function (response) {
 				console.debug("svgRepresentation response received: ", response.status);
@@ -80,4 +80,28 @@
 				return "";
 			});
 	}
+
+	static setMicroServiceProperties(loopName, jsonData) {
+		return fetch('/restservices/clds/v2/loop/updateMicroservicePolicy/' + loopName, {
+			method: 'POST',
+			credentials: 'same-origin',
+			headers: {
+				"Content-Type": "application/json",
+			},
+			body: JSON.stringify(jsonData),
+		})
+			.then(function (response) {
+				console.debug("updateMicroservicePolicy response received: ", response.status);
+				if (response.ok) {
+					return response.text();
+				} else {
+					console.error("updateMicroservicePolicy query failed");
+					return "";
+				}
+			})
+			.catch(function (error) {
+				console.error("updateMicroservicePolicy error received", error);
+				return "";
+			});
+	}
 }
