diff --git a/pkg/control/control.go b/pkg/control/control.go
index 1bb6af6..e13fc46 100755
--- a/pkg/control/control.go
+++ b/pkg/control/control.go
@@ -22,9 +22,6 @@
 import (
 	"fmt"
 	"net/http"
-	"os"
-	"strconv"
-	"strings"
 	"sync"
 	"time"
 
@@ -35,7 +32,6 @@
 	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
 	httptransport "github.com/go-openapi/runtime/client"
 	"github.com/go-openapi/strfmt"
-	"github.com/gorilla/mux"
 	"github.com/segmentio/ksuid"
 	"github.com/spf13/viper"
 )
@@ -158,9 +154,19 @@
 	c.ReadConfigParameters("")
 
 	// Register REST handler for testing support
+	xapp.Resource.InjectRoute("/ric/v1/symptomdata", c.SymptomDataHandler, "GET")
 	xapp.Resource.InjectRoute("/ric/v1/test/{testId}", c.TestRestHandler, "POST")
 	xapp.Resource.InjectRoute("/ric/v1/restsubscriptions", c.GetAllRestSubscriptions, "GET")
-	xapp.Resource.InjectRoute("/ric/v1/symptomdata", c.SymptomDataHandler, "GET")
+
+	xapp.Resource.InjectRoute("/ric/v1/get_all_e2nodes", c.GetAllE2Nodes, "GET")
+	xapp.Resource.InjectRoute("/ric/v1/get_e2node_rest_subscriptions/{ranName}", c.GetAllE2NodeRestSubscriptions, "GET")
+
+	xapp.Resource.InjectRoute("/ric/v1/get_all_xapps", c.GetAllXapps, "GET")
+	xapp.Resource.InjectRoute("/ric/v1/get_xapp_rest_restsubscriptions/{xappServiceName}", c.GetAllXappRestSubscriptions, "GET")
+	xapp.Resource.InjectRoute("/ric/v1/get_e2subscriptions/{restId}", c.GetE2Subscriptions, "GET")
+
+	xapp.Resource.InjectRoute("/ric/v1/delete_all_e2node_subscriptions/{ranName}", c.DeleteAllE2nodeSubscriptions, "GET")
+	xapp.Resource.InjectRoute("/ric/v1/delete_all_xapp_subscriptions/{xappServiceName}", c.DeleteAllXappSubscriptions, "GET")
 
 	if readSubsFromDb == "true" {
 		// Read subscriptions from db
@@ -180,10 +186,12 @@
 //-------------------------------------------------------------------
 //
 //-------------------------------------------------------------------
-func (c *Control) GetAllRestSubscriptions(w http.ResponseWriter, r *http.Request) {
-	xapp.Logger.Debug("GetAllRestSubscriptions() called")
-	response := c.registry.GetAllRestSubscriptions()
-	w.Write(response)
+func (c *Control) RESTQueryHandler() (models.SubscriptionList, error) {
+	xapp.Logger.Debug("RESTQueryHandler() called")
+
+	c.CntRecvMsg++
+
+	return c.registry.QueryHandler()
 }
 
 //-------------------------------------------------------------------
@@ -357,7 +365,7 @@
 //-------------------------------------------------------------------
 //
 //-------------------------------------------------------------------
-func (c *Control) GetOrCreateRestSubscription(p *models.SubscriptionParams, md5sum string, xAppRmrEndpoint string) (*RESTSubscription, string, error) {
+func (c *Control) GetOrCreateRestSubscription(p *models.SubscriptionParams, md5sum string, xAppRmrEndpoint string, xAppServiceName string) (*RESTSubscription, string, error) {
 
 	var restSubId string
 	var restSubscription *RESTSubscription
@@ -384,7 +392,7 @@
 
 		if restSubscription == nil {
 			restSubId = ksuid.New().String()
-			restSubscription = c.registry.CreateRESTSubscription(&restSubId, &xAppRmrEndpoint, p.Meid)
+			restSubscription = c.registry.CreateRESTSubscription(&restSubId, &xAppServiceName, &xAppRmrEndpoint, p.Meid)
 		}
 	} else {
 		// Subscription contains REST subscription Id
@@ -449,7 +457,7 @@
 		xapp.Logger.Error("Failed to generate md5sum from incoming request - %s", err.Error())
 	}
 
-	restSubscription, restSubId, err := c.GetOrCreateRestSubscription(p, md5sum, xAppRmrEndpoint)
+	restSubscription, restSubId, err := c.GetOrCreateRestSubscription(p, md5sum, xAppRmrEndpoint, p.ClientEndpoint.Host)
 	if err != nil {
 		xapp.Logger.Error("Subscription with id in REST request does not exist")
 		return nil, common.SubscribeNotFoundCode
@@ -839,50 +847,6 @@
 //-------------------------------------------------------------------
 //
 //-------------------------------------------------------------------
-func (c *Control) RESTQueryHandler() (models.SubscriptionList, error) {
-	xapp.Logger.Debug("RESTQueryHandler() called")
-
-	c.CntRecvMsg++
-
-	return c.registry.QueryHandler()
-}
-
-func (c *Control) TestRestHandler(w http.ResponseWriter, r *http.Request) {
-	xapp.Logger.Debug("RESTTestRestHandler() called")
-
-	pathParams := mux.Vars(r)
-	s := pathParams["testId"]
-
-	// This can be used to delete single subscription from db
-	if contains := strings.Contains(s, "deletesubid="); contains == true {
-		var splits = strings.Split(s, "=")
-		if subId, err := strconv.ParseInt(splits[1], 10, 64); err == nil {
-			xapp.Logger.Debug("RemoveSubscriptionFromSdl() called. subId = %v", subId)
-			c.RemoveSubscriptionFromSdl(uint32(subId))
-			return
-		}
-	}
-
-	// This can be used to remove all subscriptions db from
-	if s == "emptydb" {
-		xapp.Logger.Debug("RemoveAllSubscriptionsFromSdl() called")
-		c.RemoveAllSubscriptionsFromSdl()
-		c.RemoveAllRESTSubscriptionsFromSdl()
-		return
-	}
-
-	// This is meant to cause submgr's restart in testing
-	if s == "restart" {
-		xapp.Logger.Debug("os.Exit(1) called")
-		os.Exit(1)
-	}
-
-	xapp.Logger.Debug("Unsupported rest command received %s", s)
-}
-
-//-------------------------------------------------------------------
-//
-//-------------------------------------------------------------------
 
 func (c *Control) rmrSendToE2T(desc string, subs *Subscription, trans *TransactionSubs) (err error) {
 	params := &xapp.RMRParams{}
diff --git a/pkg/control/debug_rest_if.go b/pkg/control/debug_rest_if.go
new file mode 100644
index 0000000..cc73c72
--- /dev/null
+++ b/pkg/control/debug_rest_if.go
@@ -0,0 +1,182 @@
+/*
+==================================================================================
+  Copyright (c) 2019 AT&T Intellectual Property.
+  Copyright (c) 2019 Nokia
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================================
+*/
+
+package control
+
+import (
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"github.com/gorilla/mux"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+)
+
+func (c *Control) TestRestHandler(w http.ResponseWriter, r *http.Request) {
+	xapp.Logger.Debug("RESTTestRestHandler() called")
+
+	pathParams := mux.Vars(r)
+	s := pathParams["testId"]
+
+	// This can be used to delete single subscription from db
+	if contains := strings.Contains(s, "deletesubid="); contains == true {
+		var splits = strings.Split(s, "=")
+		if subId, err := strconv.ParseInt(splits[1], 10, 64); err == nil {
+			xapp.Logger.Debug("RemoveSubscriptionFromSdl() called. subId = %v", subId)
+			c.RemoveSubscriptionFromSdl(uint32(subId))
+			return
+		}
+	}
+
+	// This can be used to remove all subscriptions db from
+	if s == "emptydb" {
+		xapp.Logger.Debug("RemoveAllSubscriptionsFromSdl() called")
+		c.RemoveAllSubscriptionsFromSdl()
+		c.RemoveAllRESTSubscriptionsFromSdl()
+		return
+	}
+
+	// This is meant to cause submgr's restart in testing
+	if s == "restart" {
+		xapp.Logger.Debug("os.Exit(1) called")
+		os.Exit(1)
+	}
+
+	xapp.Logger.Debug("Unsupported rest command received %s", s)
+}
+
+//-------------------------------------------------------------------
+//
+//-------------------------------------------------------------------
+func (c *Control) GetAllRestSubscriptions(w http.ResponseWriter, r *http.Request) {
+
+	// Get all REST Subscriptions in subscription manager
+	xapp.Logger.Debug("GetAllRestSubscriptions() called")
+	w.Write(c.registry.GetAllRestSubscriptionsJson())
+}
+
+func (c *Control) GetAllE2Nodes(w http.ResponseWriter, r *http.Request) {
+
+	// Get all E2Nodes in subscription manager
+	xapp.Logger.Debug("GetAllE2Nodes() called")
+	w.Write(c.e2IfState.GetE2NodesJson())
+}
+
+func (c *Control) GetAllE2NodeRestSubscriptions(w http.ResponseWriter, r *http.Request) {
+	xapp.Logger.Debug("GetAllE2NodeRestSubscriptions() called: Req= %v", r.URL.Path)
+
+	// Get all REST Subscriptions of a E2Node
+	pathParams := mux.Vars(r)
+	ranName := pathParams["ranName"]
+	xapp.Logger.Debug("GetAllE2NodeRestSubscriptions() ranName=%s", ranName)
+	if ranName != "" {
+		w.Write(c.registry.GetAllE2NodeRestSubscriptionsJson(ranName))
+	} else {
+		xapp.Logger.Debug("GetAllE2NodeRestSubscriptions() Invalid path %s", ranName)
+		w.WriteHeader(400) // Bad request
+	}
+}
+
+func (c *Control) GetAllXapps(w http.ResponseWriter, r *http.Request) {
+
+	// Get all xApps in subscription manager
+	xapp.Logger.Debug("GetAllXapps() called: Req= %v", r.URL.Path)
+	w.Write(c.registry.GetAllXappsJson())
+}
+
+func (c *Control) GetAllXappRestSubscriptions(w http.ResponseWriter, r *http.Request) {
+	xapp.Logger.Debug("GetAllXappRestSubscriptions() called")
+
+	// Get all REST Subscriptions of a xApp
+	pathParams := mux.Vars(r)
+	xappServiceName := pathParams["xappServiceName"]
+	xapp.Logger.Debug("GetAllXappRestSubscriptions() xappServiceName=%s", xappServiceName)
+	if xappServiceName != "" {
+		w.Write(c.registry.GetAllXappRestSubscriptionsJson(xappServiceName))
+	} else {
+		xapp.Logger.Debug("GetAllXappRestSubscriptions() Invalid path %s", xappServiceName)
+		w.WriteHeader(400) // Bad request
+	}
+}
+
+func (c *Control) DeleteAllE2nodeSubscriptions(w http.ResponseWriter, r *http.Request) {
+	xapp.Logger.Debug("DeleteAllE2nodeSubscriptions() called: Req= %v", r.URL.Path)
+
+	// Delete all REST Subscriptions of a E2Node
+	pathParams := mux.Vars(r)
+	ranName := pathParams["ranName"]
+	xapp.Logger.Debug("DeleteE2nodeSubscriptions() ranName=%s", ranName)
+	if ranName == "" {
+		w.WriteHeader(400) // Bad request
+	}
+	nbIds := c.e2IfState.GetAllE2Nodes()
+	ranName, ok := nbIds[ranName]
+	if ok {
+		restSubscriptions := c.registry.GetAllE2NodeRestSubscriptions(ranName)
+		for restSubsId, _ := range restSubscriptions {
+			c.RESTSubscriptionDeleteHandler(restSubsId)
+		}
+		return
+	} else {
+		w.WriteHeader(404) // Not found
+	}
+}
+
+func (c *Control) DeleteAllXappSubscriptions(w http.ResponseWriter, r *http.Request) {
+	xapp.Logger.Debug("DeleteAllXappSubscriptions() called: Req= %v", r.URL.Path)
+
+	// Delete all REST Subscriptions of a xApp
+	pathParams := mux.Vars(r)
+	xappServiceName := pathParams["xappServiceName"]
+	xapp.Logger.Debug("DeleteAllXappSubscriptions() ranName=%s", xappServiceName)
+	if xappServiceName == "" {
+		w.WriteHeader(400) // Bad request
+	}
+	xapps := c.registry.GetAllXapps()
+	_, ok := xapps[xappServiceName]
+	if ok {
+		XappRestSubscriptions := c.registry.GetAllXappRestSubscriptions(xappServiceName)
+		for restSubsId, _ := range XappRestSubscriptions {
+			c.RESTSubscriptionDeleteHandler(restSubsId)
+		}
+		return
+	} else {
+		w.WriteHeader(404) // Not found
+	}
+	w.WriteHeader(200) // OK
+}
+
+func (c *Control) GetE2Subscriptions(w http.ResponseWriter, r *http.Request) {
+	xapp.Logger.Debug("GetE2Subscriptions() called: Req= %v", r.URL.Path)
+
+	// Get all E2 subscriptions of a REST Subscription
+	pathParams := mux.Vars(r)
+	restId := pathParams["restId"]
+	xapp.Logger.Debug("GetE2Subscriptions(): restId=%s", restId)
+	if restId == "" {
+		w.WriteHeader(400) // Bad request
+	}
+
+	e2Subscriptions, err := c.registry.GetE2SubscriptionsJson(restId)
+	if err != nil {
+		w.WriteHeader(404) // Not found
+	} else {
+		w.Write(e2Subscriptions)
+	}
+}
diff --git a/pkg/control/e2if_state.go b/pkg/control/e2if_state.go
index 5259618..876dfc4 100644
--- a/pkg/control/e2if_state.go
+++ b/pkg/control/e2if_state.go
@@ -20,6 +20,7 @@
 package control
 
 import (
+	"encoding/json"
 	"fmt"
 	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
 	"strings"
@@ -59,6 +60,31 @@
 	e.SubscribeChannels()
 }
 
+func (e *E2IfState) GetE2NodesJson() []byte {
+
+	e.mutex.Lock()
+	defer e.mutex.Unlock()
+
+	// Map contains something like this{"RAN_NAME_1":"RAN_NAME_1","RAN_NAME_11":"RAN_NAME_11","RAN_NAME_2":"RAN_NAME_2"}
+	var ranNameList []string
+	for _, ranName := range e.NbIdMap {
+		ranNameList = append(ranNameList, ranName)
+	}
+
+	e2NodesJson, err := json.Marshal(ranNameList)
+	if err != nil {
+		xapp.Logger.Error("GetE2Node() json.Marshal error: %v", err)
+	}
+	return e2NodesJson
+}
+
+func (e *E2IfState) GetAllE2Nodes() map[string]string {
+
+	e.mutex.Lock()
+	defer e.mutex.Unlock()
+	return e.NbIdMap
+}
+
 func (e *E2IfState) NotificationCb(ch string, events ...string) {
 
 	xapp.Logger.Debug("SDL notification received from channel=%s, event=%v", ch, events[0])
diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index 36e9b4c..3de549a 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -36,6 +36,8 @@
 //-----------------------------------------------------------------------------
 
 type RESTSubscription struct {
+	Created          time.Time
+	xAppServiceName  string
 	xAppRmrEndPoint  string
 	Meid             string
 	InstanceIds      []uint32
@@ -107,20 +109,132 @@
 	}
 }
 
-func (r *Registry) GetAllRestSubscriptions() []byte {
+func (r *Registry) GetAllRestSubscriptionsJson() []byte {
+
 	r.mutex.Lock()
 	defer r.mutex.Unlock()
 	restSubscriptionsJson, err := json.Marshal(r.restSubscriptions)
 	if err != nil {
-		xapp.Logger.Error("GetAllRestSubscriptions(): %v", err)
+		xapp.Logger.Error("GetAllRestSubscriptions() json.Marshal error: %v", err)
 	}
 	return restSubscriptionsJson
 }
 
-func (r *Registry) CreateRESTSubscription(restSubId *string, xAppRmrEndPoint *string, maid *string) *RESTSubscription {
+func (r *Registry) GetAllE2NodeRestSubscriptionsJson(ranName string) []byte {
+
+	restSubscriptions := r.GetAllE2NodeRestSubscriptions(ranName)
+	e2NodeRestSubscriptionsJson, err := json.Marshal(restSubscriptions)
+	if err != nil {
+		xapp.Logger.Error("GetE2NodeRestSubscriptions() json.Marshal error: %v", err)
+	}
+	return e2NodeRestSubscriptionsJson
+}
+
+func (r *Registry) GetAllE2NodeRestSubscriptions(ranName string) map[string]RESTSubscription {
+
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
+	var restSubscriptions map[string]RESTSubscription
+	restSubscriptions = make(map[string]RESTSubscription)
+	for restSubsId, restSubscription := range r.restSubscriptions {
+		if restSubscription.Meid == ranName {
+			restSubscriptions[restSubsId] = *restSubscription
+		}
+	}
+	return restSubscriptions
+}
+
+func (r *Registry) GetAllXappsJson() []byte {
+
+	r.mutex.Lock()
+	var xappList []string
+	var xappsMap map[string]string
+	xappsMap = make(map[string]string)
+	for _, restSubscription := range r.restSubscriptions {
+		_, ok := xappsMap[restSubscription.xAppServiceName]
+		if !ok {
+			xappsMap[restSubscription.xAppServiceName] = restSubscription.xAppServiceName
+			xappList = append(xappList, restSubscription.xAppServiceName)
+		}
+	}
+	r.mutex.Unlock()
+
+	xappsJson, err := json.Marshal(xappList)
+	if err != nil {
+		xapp.Logger.Error("GetXapps() json.Marshal error: %v", err)
+	}
+	return xappsJson
+}
+
+func (r *Registry) GetAllXapps() map[string]string {
+
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
+	var xappsMap map[string]string
+	xappsMap = make(map[string]string)
+	for _, restSubscription := range r.restSubscriptions {
+		_, ok := xappsMap[restSubscription.xAppServiceName]
+		if !ok {
+			xappsMap[restSubscription.xAppServiceName] = restSubscription.xAppServiceName
+		}
+	}
+	return xappsMap
+}
+
+func (r *Registry) GetAllXappRestSubscriptionsJson(xAppServiceName string) []byte {
+
+	xappRestSubscriptions := r.GetAllXappRestSubscriptions(xAppServiceName)
+	xappRestSubscriptionsJson, err := json.Marshal(xappRestSubscriptions)
+	if err != nil {
+		xapp.Logger.Error("GetXappRestSubscriptions() json.Marshal error: %v", err)
+	}
+	return xappRestSubscriptionsJson
+}
+
+func (r *Registry) GetAllXappRestSubscriptions(xAppServiceName string) map[string]RESTSubscription {
+
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
+	var xappRestSubscriptions map[string]RESTSubscription
+	xappRestSubscriptions = make(map[string]RESTSubscription)
+	for restSubsId, xappRestSubscription := range r.restSubscriptions {
+		if xappRestSubscription.xAppServiceName == xAppServiceName {
+			xappRestSubscriptions[restSubsId] = *xappRestSubscription
+		}
+	}
+	return xappRestSubscriptions
+}
+
+func (r *Registry) GetE2SubscriptionsJson(restSubsId string) ([]byte, error) {
+
+	// Get all E2 subscriptions of a REST subscription
+	restSubs, err := r.GetRESTSubscription(restSubsId, false)
+	if err != nil {
+		return nil, err
+	}
+
+	r.mutex.Lock()
+	var e2Subscriptions []Subscription
+	for _, e2SubId := range restSubs.InstanceIds {
+		e2Subscription, ok := r.register[e2SubId]
+		if ok {
+			e2Subscriptions = append(e2Subscriptions, *e2Subscription)
+		}
+	}
+	r.mutex.Unlock()
+	e2SubscriptionsJson, err := json.Marshal(e2Subscriptions)
+	if err != nil {
+		xapp.Logger.Error("GetE2Subscriptions() json.Marshal error: %v", err)
+	}
+	return e2SubscriptionsJson, nil
+}
+
+func (r *Registry) CreateRESTSubscription(restSubId *string, xappServiceName *string, xAppRmrEndPoint *string, maid *string) *RESTSubscription {
 	r.mutex.Lock()
 	defer r.mutex.Unlock()
 	newRestSubscription := RESTSubscription{}
+	newRestSubscription.Created = time.Now()
+	newRestSubscription.xAppServiceName = *xappServiceName
 	newRestSubscription.xAppRmrEndPoint = *xAppRmrEndPoint
 	newRestSubscription.Meid = *maid
 	newRestSubscription.SubReqOngoing = true
diff --git a/pkg/control/sdl_restSubsDb.go b/pkg/control/sdl_restSubsDb.go
index a0afbc0..576e6af 100644
--- a/pkg/control/sdl_restSubsDb.go
+++ b/pkg/control/sdl_restSubsDb.go
@@ -22,6 +22,7 @@
 import (
 	"encoding/json"
 	"fmt"
+	"time"
 
 	sdl "gerrit.o-ran-sc.org/r/ric-plt/sdlgo"
 	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
@@ -30,6 +31,8 @@
 const restSubSdlNs = "submgr_restSubsDb"
 
 type RESTSubscriptionInfo struct {
+	Created          time.Time
+	XAppServiceName  string
 	XAppRmrEndPoint  string
 	Meid             string
 	InstanceIds      []uint32
@@ -46,6 +49,8 @@
 func (c *Control) WriteRESTSubscriptionToSdl(restSubId string, restSubs *RESTSubscription) error {
 
 	var restSubscriptionInfo RESTSubscriptionInfo
+	restSubscriptionInfo.Created = restSubs.Created
+	restSubscriptionInfo.XAppServiceName = restSubs.xAppServiceName
 	restSubscriptionInfo.XAppRmrEndPoint = restSubs.xAppRmrEndPoint
 	restSubscriptionInfo.Meid = restSubs.Meid
 	restSubscriptionInfo.InstanceIds = restSubs.InstanceIds
@@ -104,6 +109,8 @@
 func (c *Control) CreateRESTSubscription(restSubscriptionInfo *RESTSubscriptionInfo, jsonSubscriptionInfo *string) *RESTSubscription {
 
 	restSubs := &RESTSubscription{}
+	restSubs.Created = restSubscriptionInfo.Created
+	restSubs.xAppServiceName = restSubscriptionInfo.XAppServiceName
 	restSubs.xAppRmrEndPoint = restSubscriptionInfo.XAppRmrEndPoint
 	restSubs.Meid = restSubscriptionInfo.Meid
 	restSubs.InstanceIds = restSubscriptionInfo.InstanceIds
diff --git a/pkg/control/sdl_restSubsDb_test.go b/pkg/control/sdl_restSubsDb_test.go
index 3db8a2d..5e1db60 100644
--- a/pkg/control/sdl_restSubsDb_test.go
+++ b/pkg/control/sdl_restSubsDb_test.go
@@ -89,6 +89,7 @@
 	t.Log("TEST: Creating REST subscription")
 
 	restSubscription := &RESTSubscription{}
+	restSubscription.xAppServiceName = "localhost"
 	restSubscription.xAppRmrEndPoint = "localhost:13560"
 	restSubscription.Meid = "RAN_NAME_1"
 	restSubscription.SubReqOngoing = true
@@ -100,6 +101,7 @@
 
 func PrintRESTSubscriptionData(t *testing.T, restSubs *RESTSubscription) {
 	t.Log("TEST: RESTSubscription data")
+	t.Logf("TEST: restSubs.xAppServiceName = %v", restSubs.xAppServiceName)
 	t.Logf("TEST: restSubs.xAppRmrEndPoint = %v", restSubs.xAppRmrEndPoint)
 	t.Logf("TEST: restSubs.Meid = %v", restSubs.Meid)
 	t.Logf("TEST: restSubs.InstanceIds = %v", restSubs.InstanceIds)
diff --git a/pkg/control/ut_ctrl_submgr_test.go b/pkg/control/ut_ctrl_submgr_test.go
index 1563a00..78d9990 100644
--- a/pkg/control/ut_ctrl_submgr_test.go
+++ b/pkg/control/ut_ctrl_submgr_test.go
@@ -449,20 +449,21 @@
 	return retCounterMap
 }
 
-func (mc *testingSubmgrControl) sendGetRequest(t *testing.T, addr string, path string) {
+func (mc *testingSubmgrControl) SendGetRequest(t *testing.T, addr string, path string) []byte {
 
 	mc.TestLog(t, "GET http://"+addr+"%v", path)
 	req, err := http.NewRequest("GET", "http://"+addr+path, nil)
 	if err != nil {
 		mc.TestError(t, "Error reading request. %v", err)
-		return
+		return nil
 	}
-	req.Header.Set("Cache-Control", "no-cache")
+
+	req.Header.Set("accept", "application/json")
 	client := &http.Client{Timeout: time.Second * 2}
 	resp, err := client.Do(req)
 	if err != nil {
 		mc.TestError(t, "Error reading response. %v", err)
-		return
+		return nil
 	}
 	defer resp.Body.Close()
 
@@ -470,19 +471,19 @@
 	mc.TestLog(t, "Response Headers: %v", resp.Header)
 	if !strings.Contains(resp.Status, "200 OK") {
 		mc.TestError(t, "Wrong response status")
-		return
+		return nil
 	}
 
 	respBody, err := ioutil.ReadAll(resp.Body)
 	if err != nil {
 		mc.TestError(t, "Error reading body. %v", err)
-		return
+		return nil
 	}
 	mc.TestLog(t, "%s", respBody)
-	return
+	return respBody
 }
 
-func (mc *testingSubmgrControl) sendPostRequest(t *testing.T, addr string, path string) {
+func (mc *testingSubmgrControl) SendPostRequest(t *testing.T, addr string, path string) {
 
 	mc.TestLog(t, "POST http://"+addr+"%v", path)
 	req, err := http.NewRequest("POST", "http://"+addr+path, nil)
@@ -490,6 +491,7 @@
 		mc.TestError(t, "Error reading request. %v", err)
 		return
 	}
+	req.Header.Set("accept", "application/json")
 	client := &http.Client{Timeout: time.Second * 2}
 	resp, err := client.Do(req)
 	if err != nil {
@@ -514,12 +516,52 @@
 	return
 }
 
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
+func (mc *testingSubmgrControl) SendDeleteRequest(t *testing.T, addr string, path string) {
+
+	mc.TestLog(t, "DELETE http://"+addr+"%v", path)
+	req, err := http.NewRequest("DELETE", "http://"+addr+path, nil)
+	if err != nil {
+		mc.TestError(t, "Error reading request. %v", err)
+		return
+	}
+	req.Header.Set("accept", "application/json")
+	client := &http.Client{Timeout: time.Second * 2}
+	resp, err := client.Do(req)
+	if err != nil {
+		mc.TestError(t, "Error reading response. %v", err)
+		return
+	}
+	defer resp.Body.Close()
+
+	mc.TestLog(t, "Response status: %v", resp.Status)
+	mc.TestLog(t, "Response Headers: %v", resp.Header)
+	if !strings.Contains(resp.Status, "204 No Content") {
+		mc.TestError(t, "Wrong response status")
+		return
+	}
+
+	respBody, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		mc.TestError(t, "Error reading body. %v", err)
+		return
+	}
+	mc.TestLog(t, "%s", respBody)
+	return
+}
+
 func (mc *testingSubmgrControl) SetE2State(t *testing.T, ranNameState string) {
 
 	if err := mc.c.e2IfStateDb.XappRnibStoreAndPublish("RAN_CONNECTION_STATUS_CHANGE", ranNameState, "key1", "data1"); err != nil {
 		t.Errorf("XappRnibStoreAndPublish failed: %v", err)
 	}
 }
+
+func (mc *testingSubmgrControl) VerifyStringExistInSlice(verifiedString string, list []string) bool {
+
+	for _, listItem := range list {
+		if listItem == verifiedString {
+			return true
+		}
+	}
+	return false
+}
diff --git a/pkg/control/ut_messaging_test.go b/pkg/control/ut_messaging_test.go
index b4edc3f..3e9a51b 100644
--- a/pkg/control/ut_messaging_test.go
+++ b/pkg/control/ut_messaging_test.go
@@ -20,6 +20,7 @@
 package control
 
 import (
+	"encoding/json"
 	"strings"
 	"testing"
 	"time"
@@ -2632,27 +2633,315 @@
 //     |              |
 func TestGetSubscriptions(t *testing.T) {
 
-	mainCtrl.sendGetRequest(t, "localhost:8088", "/ric/v1/subscriptions")
+	mainCtrl.SendGetRequest(t, "localhost:8088", "/ric/v1/subscriptions")
 }
 
 func TestGetSymptomData(t *testing.T) {
 
-	mainCtrl.sendGetRequest(t, "localhost:8080", "/ric/v1/symptomdata")
+	mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/symptomdata")
 }
 
 func TestPostdeleteSubId(t *testing.T) {
 
-	mainCtrl.sendPostRequest(t, "localhost:8080", "/ric/v1/test/deletesubid=1")
+	mainCtrl.SendPostRequest(t, "localhost:8080", "/ric/v1/test/deletesubid=1")
 }
 
 func TestPostEmptyDb(t *testing.T) {
 
-	mainCtrl.sendPostRequest(t, "localhost:8080", "/ric/v1/test/emptydb")
+	mainCtrl.SendPostRequest(t, "localhost:8080", "/ric/v1/test/emptydb")
 }
 
 func TestGetRestSubscriptions(t *testing.T) {
 
-	mainCtrl.sendGetRequest(t, "localhost:8080", "/ric/v1/restsubscriptions")
+	mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/restsubscriptions")
+}
+
+//-----------------------------------------------------------------------------
+// TestDelAllE2nodeSubsViaDebugIf
+//
+//   stub                             stub          stub
+// +-------+        +---------+    +---------+   +---------+
+// | xapp  |        | submgr  |    | e2term  |   |  rtmgr  |
+// +-------+        +---------+    +---------+   +---------+
+//     |                 |              |             |
+//     | RESTSubReq      |              |             |
+//     |---------------->|              |             |
+//     |     RESTSubResp |              |             |
+//     |<----------------|              |             |
+//     |                 | RouteCreate  |             |
+//     |                 |--------------------------->|
+//     |                 | RouteResponse|             |
+//     |                 |<---------------------------|
+//     |                 | SubReq       |             |
+//     |                 |------------->|             |
+//     |                 |      SubResp |             |
+//     |                 |<-------------|             |
+//     |      RESTNotif1 |              |             |
+//     |<----------------|              |             |
+//     |                 |              |             |
+//     | REST get_all_e2nodes           |             |
+//     |---------------->|              |             |
+//     |    OK 200       |              |             |
+//     |<----------------|              |             |
+//     | REST delete_all_e2node_subscriptions         | ranName = RAN_NAME_1
+//     |---------------->|              |             |
+//     |    OK 200       |              |             |
+//     |<----------------|              |             |
+//     |                 | SubDelReq    |             |
+//     |                 |------------->|             |
+//     |                 |   SubDelResp |             |
+//     |                 |<-------------|             |
+//     |                 |              |             |
+//     |                 | RouteDelete  |             |
+//     |                 |--------------------------->|
+//     |                 | RouteResponse|             |
+//     |                 |<---------------------------|
+//
+//-----------------------------------------------------------------------------
+
+func TestDelAllE2nodeSubsViaDebugIf(t *testing.T) {
+
+	// Init counter check
+	mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
+		Counter{cRestSubReqFromXapp, 1},
+		Counter{cRestSubRespToXapp, 1},
+		Counter{cSubReqToE2, 1},
+		Counter{cSubRespFromE2, 1},
+		Counter{cRestSubNotifToXapp, 1},
+		Counter{cRestSubDelReqFromXapp, 1},
+		Counter{cSubDelReqToE2, 1},
+		Counter{cSubDelRespFromE2, 1},
+		Counter{cRestSubDelRespToXapp, 1},
+	})
+
+	params := xappConn1.GetRESTSubsReqReportParams(subReqCount)
+	restSubId := xappConn1.SendRESTSubsReq(t, params)
+	xapp.Logger.Debug("Send REST Policy subscriber request for subscriberId : %v", restSubId)
+
+	crereq1, cremsg1 := e2termConn1.RecvSubsReq(t)
+	xappConn1.ExpectRESTNotification(t, restSubId)
+	e2termConn1.SendSubsResp(t, crereq1, cremsg1)
+	e2SubsId := xappConn1.WaitRESTNotification(t, restSubId)
+	xapp.Logger.Debug("REST notification received e2SubsId=%v", e2SubsId)
+
+	e2nodesJson := mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/get_all_e2nodes")
+
+	var e2nodesList []string
+	err := json.Unmarshal(e2nodesJson, &e2nodesList)
+	if err != nil {
+		t.Errorf("Unmarshal error: %s", err)
+	}
+	assert.Equal(t, true, mainCtrl.VerifyStringExistInSlice("RAN_NAME_1", e2nodesList))
+
+	e2RestSubsJson := mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/get_e2node_rest_subscriptions/RAN_NAME_1") // RAN_NAME_1 = ranName
+	var e2RestSubsMap map[string]RESTSubscription
+	err = json.Unmarshal(e2RestSubsJson, &e2RestSubsMap)
+	if err != nil {
+		t.Errorf("Unmarshal error: %s", err)
+	}
+
+	if len(e2RestSubsMap) != 1 {
+		t.Errorf("Incorrect e2RestSubsMap length %v", len(e2RestSubsMap))
+	}
+
+	// Simulate deletion through REST test and debug interface
+	mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/delete_all_e2node_subscriptions/RAN_NAME_1") // RAN_NAME_1 = ranName
+	delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
+	e2termConn1.SendSubsDelResp(t, delreq, delmsg)
+
+	// Wait that subs is cleaned
+	waitSubsCleanup(t, e2SubsId, 10)
+	mainCtrl.VerifyCounterValues(t)
+	mainCtrl.VerifyAllClean(t)
+}
+
+//-----------------------------------------------------------------------------
+// TestDelAllxAppSubsViaDebugIf
+//
+//   stub                             stub          stub
+// +-------+        +---------+    +---------+   +---------+
+// | xapp  |        | submgr  |    | e2term  |   |  rtmgr  |
+// +-------+        +---------+    +---------+   +---------+
+//     |                 |              |             |
+//     | RESTSubReq      |              |             |
+//     |---------------->|              |             |
+//     |     RESTSubResp |              |             |
+//     |<----------------|              |             |
+//     |                 | RouteCreate  |             |
+//     |                 |--------------------------->|
+//     |                 | RouteResponse|             |
+//     |                 |<---------------------------|
+//     |                 | SubReq       |             |
+//     |                 |------------->|             |
+//     |                 |      SubResp |             |
+//     |                 |<-------------|             |
+//     |      RESTNotif1 |              |             |
+//     |<----------------|              |             |
+//     |                 |              |             |
+//     | REST get_all_xapps             |             |
+//     |---------------->|              |             |
+//     |    OK 200       |              |             |
+//     |<----------------|              |             |
+//     | REST delete_all_xapp_subscriptions           |  xappServiceName = localhost
+//     |---------------->|              |             |
+//     |    OK 200       |              |             |
+//     |<----------------|              |             |
+//     |                 | SubDelReq    |             |
+//     |                 |------------->|             |
+//     |                 |   SubDelResp |             |
+//     |                 |<-------------|             |
+//     |                 |              |             |
+//     |                 | RouteDelete  |             |
+//     |                 |--------------------------->|
+//     |                 | RouteResponse|             |
+//     |                 |<---------------------------|
+//
+//-----------------------------------------------------------------------------
+
+func TestDelAllxAppSubsViaDebugIf(t *testing.T) {
+
+	// Init counter check
+	mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
+		Counter{cRestSubReqFromXapp, 1},
+		Counter{cRestSubRespToXapp, 1},
+		Counter{cSubReqToE2, 1},
+		Counter{cSubRespFromE2, 1},
+		Counter{cRestSubNotifToXapp, 1},
+		Counter{cRestSubDelReqFromXapp, 1},
+		Counter{cSubDelReqToE2, 1},
+		Counter{cSubDelRespFromE2, 1},
+		Counter{cRestSubDelRespToXapp, 1},
+	})
+
+	params := xappConn1.GetRESTSubsReqReportParams(subReqCount)
+	restSubId := xappConn1.SendRESTSubsReq(t, params)
+	xapp.Logger.Debug("Send REST Policy subscriber request for subscriberId : %v", restSubId)
+
+	crereq1, cremsg1 := e2termConn1.RecvSubsReq(t)
+	xappConn1.ExpectRESTNotification(t, restSubId)
+	e2termConn1.SendSubsResp(t, crereq1, cremsg1)
+	e2SubsId := xappConn1.WaitRESTNotification(t, restSubId)
+	xapp.Logger.Debug("REST notification received e2SubsId=%v", e2SubsId)
+
+	xappsJson := mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/get_all_xapps")
+
+	var xappList []string
+	err := json.Unmarshal(xappsJson, &xappList)
+	if err != nil {
+		t.Errorf("Unmarshal error: %s", err)
+	}
+	assert.Equal(t, true, mainCtrl.VerifyStringExistInSlice("localhost", xappList))
+
+	// Simulate deletion through REST test and debug interface
+	mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/delete_all_xapp_subscriptions/localhost") // localhost = xappServiceName
+	delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
+	e2termConn1.SendSubsDelResp(t, delreq, delmsg)
+
+	// Wait that subs is cleaned
+	waitSubsCleanup(t, e2SubsId, 10)
+	mainCtrl.VerifyCounterValues(t)
+	mainCtrl.VerifyAllClean(t)
+}
+
+//-----------------------------------------------------------------------------
+// TestDelViaxAppSubsIf
+//
+//   stub                             stub          stub
+// +-------+        +---------+    +---------+   +---------+
+// | xapp  |        | submgr  |    | e2term  |   |  rtmgr  |
+// +-------+        +---------+    +---------+   +---------+
+//     |                 |              |             |
+//     | RESTSubReq      |              |             |
+//     |---------------->|              |             |
+//     |     RESTSubResp |              |             |
+//     |<----------------|              |             |
+//     |                 | RouteCreate  |             |
+//     |                 |--------------------------->|
+//     |                 | RouteResponse|             |
+//     |                 |<---------------------------|
+//     |                 | SubReq       |             |
+//     |                 |------------->|             |
+//     |                 |      SubResp |             |
+//     |                 |<-------------|             |
+//     |      RESTNotif1 |              |             |
+//     |<----------------|              |             |
+//     |                 |              |             |
+//     | REST get_xapp_rest_restsubscriptions         |
+//     |---------------->|              |             |
+//     |    OK 200       |              |             |
+//     |<----------------|              |             |
+//     | RESTSudDel      |              |             |
+//     |---------------->|              |             | Via user curl command (port 8088)
+//     |     RESTSudDel  |              |             |
+//     |<----------------|              |             |
+//     |                 | SubDelReq    |             |
+//     |                 |------------->|             |
+//     |                 |   SubDelResp |             |
+//     |                 |<-------------|             |
+//     |                 |              |             |
+//     |                 | RouteDelete  |             |
+//     |                 |--------------------------->|
+//     |                 | RouteResponse|             |
+//     |                 |<---------------------------|
+//
+//-----------------------------------------------------------------------------
+
+func TestDelViaxAppSubsIf(t *testing.T) {
+
+	// Init counter check
+	mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
+		Counter{cRestSubReqFromXapp, 1},
+		Counter{cRestSubRespToXapp, 1},
+		Counter{cSubReqToE2, 1},
+		Counter{cSubRespFromE2, 1},
+		Counter{cRestSubNotifToXapp, 1},
+		Counter{cRestSubDelReqFromXapp, 1},
+		Counter{cSubDelReqToE2, 1},
+		Counter{cSubDelRespFromE2, 1},
+		Counter{cRestSubDelRespToXapp, 1},
+	})
+
+	params := xappConn1.GetRESTSubsReqReportParams(subReqCount)
+	restSubId := xappConn1.SendRESTSubsReq(t, params)
+	xapp.Logger.Debug("Send REST Policy subscriber request for subscriberId : %v", restSubId)
+
+	crereq1, cremsg1 := e2termConn1.RecvSubsReq(t)
+	xappConn1.ExpectRESTNotification(t, restSubId)
+	e2termConn1.SendSubsResp(t, crereq1, cremsg1)
+	e2SubsId := xappConn1.WaitRESTNotification(t, restSubId)
+	xapp.Logger.Debug("REST notification received e2SubsId=%v", e2SubsId)
+
+	restSubsListJson := mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/get_xapp_rest_restsubscriptions/localhost") // localhost = xappServiceName
+
+	var restSubsMap map[string]RESTSubscription
+	err := json.Unmarshal(restSubsListJson, &restSubsMap)
+	if err != nil {
+		t.Errorf("Unmarshal error: %s", err)
+	}
+	_, ok := restSubsMap[restSubId]
+	if !ok {
+		t.Errorf("REST subscription not found. restSubId=%s", restSubId)
+	}
+
+	var e2Subscriptions []Subscription
+	e2SubscriptionsJson := mainCtrl.SendGetRequest(t, "localhost:8080", "/ric/v1/get_e2subscriptions/"+restSubId)
+	err = json.Unmarshal(e2SubscriptionsJson, &e2Subscriptions)
+	if err != nil {
+		t.Errorf("Unmarshal error: %s", err)
+	}
+	if len(e2Subscriptions) != 1 {
+		t.Errorf("Incorrect e2Subscriptions length %v", len(e2Subscriptions))
+	}
+
+	// Simulate deletion through xapp REST test interface
+	mainCtrl.SendDeleteRequest(t, "localhost:8088", "/ric/v1/subscriptions/"+restSubId)
+	delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
+	e2termConn1.SendSubsDelResp(t, delreq, delmsg)
+
+	// Wait that subs is cleaned
+	waitSubsCleanup(t, e2SubsId, 10)
+	mainCtrl.VerifyCounterValues(t)
+	mainCtrl.VerifyAllClean(t)
 }
 
 //-----------------------------------------------------------------------------
@@ -3961,6 +4250,7 @@
 //     | RESTSubResp     |              |
 //     |<----------------|              |
 //     |                 | SubReq       |
+//     |                 |------------->|
 //     |                 |              |
 //     |                 |              |
 //     |                 | SubReq       |
