[ISSUE-67901957] add tests, change identifiers to outermost
diff --git a/accessEntity/api.go b/accessEntity/api.go
index f261f1e..75edd9c 100644
--- a/accessEntity/api.go
+++ b/accessEntity/api.go
@@ -260,12 +260,14 @@
 			log.Errorf("getCompanyDeveloper: %v", err)
 			return nil, newDbError(err)
 		}
-		detail := makeComDevDetails(&dev, comName, email, priKey, priVal)
+		detail := makeComDevDetails(&dev, comName, email)
 		details = append(details, detail)
 	}
 	return &CompanyDevelopersSuccessResponse{
-		CompanyDevelopers: details,
-		Organization:      org,
+		CompanyDevelopers:      details,
+		Organization:           org,
+		PrimaryIdentifierType:  priKey,
+		PrimaryIdentifierValue: priVal,
 	}, nil
 }
 
@@ -301,10 +303,12 @@
 		log.Errorf("getDeveloper: %v", err)
 		return nil, newDbError(err)
 	}
-	details := makeDevDetails(dev, appNames, comNames, attrs, priKey, priVal)
+	details := makeDevDetails(dev, appNames, comNames, attrs)
 	return &DeveloperSuccessResponse{
-		Developer:    details,
-		Organization: org,
+		Developer:              details,
+		Organization:           org,
+		PrimaryIdentifierType:  priKey,
+		PrimaryIdentifierValue: priVal,
 	}, nil
 }
 
@@ -335,10 +339,12 @@
 		log.Errorf("getCompany: %v", err)
 		return nil, newDbError(err)
 	}
-	details := makeCompanyDetails(com, appNames, attrs, priKey, priVal)
+	details := makeCompanyDetails(com, appNames, attrs)
 	return &CompanySuccessResponse{
-		Company:      details,
-		Organization: org,
+		Company:                details,
+		Organization:           org,
+		PrimaryIdentifierType:  priKey,
+		PrimaryIdentifierValue: priVal,
 	}, nil
 }
 
@@ -364,14 +370,18 @@
 	}
 	prod := &prods[0]
 	attrs = a.DbMan.GetKmsAttributes(prod.TenantId, prod.Id)[prod.Id]
-	details, errRes := makeApiProductDetails(prod, attrs, priKey, priVal, secKey, secVal)
+	details, errRes := makeApiProductDetails(prod, attrs)
 	if errRes != nil {
 		return nil, errRes
 	}
 
 	return &ApiProductSuccessResponse{
-		ApiProduct:   details,
-		Organization: org,
+		ApiProduct:               details,
+		Organization:             org,
+		PrimaryIdentifierType:    priKey,
+		PrimaryIdentifierValue:   priVal,
+		SecondaryIdentifierType:  secKey,
+		SecondaryIdentifierValue: secVal,
 	}, nil
 }
 
@@ -422,10 +432,12 @@
 	//TODO: isValidKey
 	cks := makeConsumerKeyStatusDetails(app, cd, devStatus, "")
 	//TODO: redirectUris
-	details := makeAppCredentialDetails(appCred, cks, []string{}, attrs, priKey, priVal)
+	details := makeAppCredentialDetails(appCred, cks, []string{}, attrs)
 	return &AppCredentialSuccessResponse{
-		AppCredential: details,
-		Organization:  org,
+		AppCredential:          details,
+		Organization:           org,
+		PrimaryIdentifierType:  priKey,
+		PrimaryIdentifierValue: priVal,
 	}, nil
 }
 
@@ -474,13 +486,17 @@
 		credDetails = append(credDetails, a.getCredDetails(&cred, app.Status))
 	}
 
-	details, errRes := makeAppDetails(app, parStatus, prods, credDetails, attrs, priKey, priVal, secKey, secVal)
+	details, errRes := makeAppDetails(app, parStatus, prods, credDetails, attrs)
 	if errRes != nil {
 		return nil, errRes
 	}
 	return &AppSuccessResponse{
-		App:          details,
-		Organization: org,
+		App:                      details,
+		Organization:             org,
+		PrimaryIdentifierType:    priKey,
+		PrimaryIdentifierValue:   priVal,
+		SecondaryIdentifierType:  secKey,
+		SecondaryIdentifierValue: secVal,
 	}, nil
 }
 
@@ -497,24 +513,22 @@
 	}
 }
 
-func makeAppCredentialDetails(ac *common.AppCredential, cks *ConsumerKeyStatusDetails, redirectUrl []string, attrs []common.Attribute, priKey, priVal string) *AppCredentialDetails {
+func makeAppCredentialDetails(ac *common.AppCredential, cks *ConsumerKeyStatusDetails, redirectUrl []string, attrs []common.Attribute) *AppCredentialDetails {
 	return &AppCredentialDetails{
-		AppID:                  ac.AppId,
-		AppName:                cks.AppName,
-		Attributes:             attrs,
-		ConsumerKey:            ac.Id,
-		ConsumerKeyStatus:      cks,
-		ConsumerSecret:         ac.ConsumerSecret,
-		DeveloperID:            cks.DeveloperID,
-		PrimaryIdentifierType:  priKey,
-		PrimaryIdentifierValue: priVal,
-		RedirectUris:           redirectUrl, //TODO
-		Scopes:                 common.JsonToStringArray(ac.Scopes),
-		Status:                 ac.Status,
+		AppID:             ac.AppId,
+		AppName:           cks.AppName,
+		Attributes:        attrs,
+		ConsumerKey:       ac.Id,
+		ConsumerKeyStatus: cks,
+		ConsumerSecret:    ac.ConsumerSecret,
+		DeveloperID:       cks.DeveloperID,
+		RedirectUris:      redirectUrl, //TODO
+		Scopes:            common.JsonToStringArray(ac.Scopes),
+		Status:            ac.Status,
 	}
 }
 
-func makeApiProductDetails(prod *common.ApiProduct, attrs []common.Attribute, priKey, priVal, secKey, secVal string) (*ApiProductDetails, *common.ErrorResponse) {
+func makeApiProductDetails(prod *common.ApiProduct, attrs []common.Attribute) (*ApiProductDetails, *common.ErrorResponse) {
 	var a *ApiProductDetails
 	if prod != nil {
 		var quotaLimit int
@@ -527,27 +541,23 @@
 		}
 
 		a = &ApiProductDetails{
-			ApiProxies:               common.JsonToStringArray(prod.Proxies),
-			ApiResources:             common.JsonToStringArray(prod.ApiResources),
-			ApprovalType:             prod.ApprovalType,
-			Attributes:               attrs,
-			CreatedAt:                prod.CreatedAt,
-			CreatedBy:                prod.CreatedBy,
-			Description:              prod.Description,
-			DisplayName:              prod.DisplayName,
-			Environments:             common.JsonToStringArray(prod.Environments),
-			ID:                       prod.Id,
-			LastModifiedAt:           prod.UpdatedAt,
-			LastModifiedBy:           prod.UpdatedBy,
-			Name:                     prod.Name,
-			QuotaInterval:            prod.QuotaInterval,
-			QuotaLimit:               int64(quotaLimit),
-			QuotaTimeUnit:            prod.QuotaTimeUnit,
-			Scopes:                   common.JsonToStringArray(prod.Scopes),
-			PrimaryIdentifierType:    priKey,
-			PrimaryIdentifierValue:   priVal,
-			SecondaryIdentifierType:  secKey,
-			SecondaryIdentifierValue: secVal,
+			ApiProxies:     common.JsonToStringArray(prod.Proxies),
+			ApiResources:   common.JsonToStringArray(prod.ApiResources),
+			ApprovalType:   prod.ApprovalType,
+			Attributes:     attrs,
+			CreatedAt:      prod.CreatedAt,
+			CreatedBy:      prod.CreatedBy,
+			Description:    prod.Description,
+			DisplayName:    prod.DisplayName,
+			Environments:   common.JsonToStringArray(prod.Environments),
+			ID:             prod.Id,
+			LastModifiedAt: prod.UpdatedAt,
+			LastModifiedBy: prod.UpdatedBy,
+			Name:           prod.Name,
+			QuotaInterval:  prod.QuotaInterval,
+			QuotaLimit:     int64(quotaLimit),
+			QuotaTimeUnit:  prod.QuotaTimeUnit,
+			Scopes:         common.JsonToStringArray(prod.Scopes),
 		}
 	} else {
 		a = new(ApiProductDetails)
@@ -555,33 +565,29 @@
 	return a, nil
 }
 
-func makeAppDetails(app *common.App, parentStatus string, prods []string, creds []*CredentialDetails, attrs []common.Attribute, priKey, priVal, secKey, secVal string) (*AppDetails, *common.ErrorResponse) {
+func makeAppDetails(app *common.App, parentStatus string, prods []string, creds []*CredentialDetails, attrs []common.Attribute) (*AppDetails, *common.ErrorResponse) {
 	var a *AppDetails
 	if app != nil {
 		a = &AppDetails{
-			AccessType:               app.AccessType,
-			ApiProducts:              prods,
-			AppCredentials:           creds,
-			AppFamily:                app.AppFamily,
-			AppParentID:              app.ParentId,
-			AppParentStatus:          parentStatus,
-			AppType:                  app.Type,
-			Attributes:               attrs,
-			CallbackUrl:              app.CallbackUrl,
-			CreatedAt:                app.CreatedAt,
-			CreatedBy:                app.CreatedBy,
-			DisplayName:              app.DisplayName,
-			Id:                       app.Id,
-			KeyExpiresIn:             "", //TODO
-			LastModifiedAt:           app.UpdatedAt,
-			LastModifiedBy:           app.UpdatedBy,
-			Name:                     app.Name,
-			Scopes:                   []string{}, //TODO
-			Status:                   app.Status,
-			PrimaryIdentifierType:    priKey,
-			PrimaryIdentifierValue:   priVal,
-			SecondaryIdentifierType:  secKey,
-			SecondaryIdentifierValue: secVal,
+			AccessType:      app.AccessType,
+			ApiProducts:     prods,
+			AppCredentials:  creds,
+			AppFamily:       app.AppFamily,
+			AppParentID:     app.ParentId,
+			AppParentStatus: parentStatus,
+			AppType:         app.Type,
+			Attributes:      attrs,
+			CallbackUrl:     app.CallbackUrl,
+			CreatedAt:       app.CreatedAt,
+			CreatedBy:       app.CreatedBy,
+			DisplayName:     app.DisplayName,
+			Id:              app.Id,
+			KeyExpiresIn:    "", //TODO
+			LastModifiedAt:  app.UpdatedAt,
+			LastModifiedBy:  app.UpdatedBy,
+			Name:            app.Name,
+			Scopes:          []string{}, //TODO
+			Status:          app.Status,
 		}
 	} else {
 		a = new(AppDetails)
@@ -589,7 +595,7 @@
 	return a, nil
 }
 
-func makeCompanyDetails(com *common.Company, appNames []string, attrs []common.Attribute, priKey, priVal string) *CompanyDetails {
+func makeCompanyDetails(com *common.Company, appNames []string, attrs []common.Attribute) *CompanyDetails {
 	return &CompanyDetails{
 		Apps:           appNames,
 		Attributes:     attrs,
@@ -600,44 +606,38 @@
 		LastModifiedAt: com.UpdatedAt,
 		LastModifiedBy: com.UpdatedBy,
 		Name:           com.Name,
-		PrimaryIdentifierType:  priKey,
-		PrimaryIdentifierValue: priVal,
-		Status:                 com.Status,
+		Status:         com.Status,
 	}
 }
 
-func makeDevDetails(dev *common.Developer, appNames []string, comNames []string, attrs []common.Attribute, priKey, priVal string) *DeveloperDetails {
+func makeDevDetails(dev *common.Developer, appNames []string, comNames []string, attrs []common.Attribute) *DeveloperDetails {
 	return &DeveloperDetails{
-		Apps:                   appNames,
-		Attributes:             attrs,
-		Companies:              comNames,
-		CreatedAt:              dev.CreatedAt,
-		CreatedBy:              dev.CreatedBy,
-		Email:                  dev.Email,
-		FirstName:              dev.FirstName,
-		ID:                     dev.Id,
-		LastModifiedAt:         dev.UpdatedAt,
-		LastModifiedBy:         dev.UpdatedBy,
-		LastName:               dev.LastName,
-		Password:               dev.Password,
-		PrimaryIdentifierType:  priKey,
-		PrimaryIdentifierValue: priVal,
-		Status:                 dev.Status,
-		UserName:               dev.UserName,
+		Apps:           appNames,
+		Attributes:     attrs,
+		Companies:      comNames,
+		CreatedAt:      dev.CreatedAt,
+		CreatedBy:      dev.CreatedBy,
+		Email:          dev.Email,
+		FirstName:      dev.FirstName,
+		ID:             dev.Id,
+		LastModifiedAt: dev.UpdatedAt,
+		LastModifiedBy: dev.UpdatedBy,
+		LastName:       dev.LastName,
+		Password:       dev.Password,
+		Status:         dev.Status,
+		UserName:       dev.UserName,
 	}
 }
 
-func makeComDevDetails(comDev *common.CompanyDeveloper, comName, devEmail, priKey, priVal string) *CompanyDeveloperDetails {
+func makeComDevDetails(comDev *common.CompanyDeveloper, comName, devEmail string) *CompanyDeveloperDetails {
 	return &CompanyDeveloperDetails{
-		CompanyName:            comName,
-		CreatedAt:              comDev.CreatedAt,
-		CreatedBy:              comDev.CreatedBy,
-		DeveloperEmail:         devEmail,
-		LastModifiedAt:         comDev.UpdatedAt,
-		LastModifiedBy:         comDev.UpdatedBy,
-		PrimaryIdentifierType:  priKey,
-		PrimaryIdentifierValue: priVal,
-		Roles: common.JsonToStringArray(comDev.Roles),
+		CompanyName:    comName,
+		CreatedAt:      comDev.CreatedAt,
+		CreatedBy:      comDev.CreatedBy,
+		DeveloperEmail: devEmail,
+		LastModifiedAt: comDev.UpdatedAt,
+		LastModifiedBy: comDev.UpdatedBy,
+		Roles:          common.JsonToStringArray(comDev.Roles),
 	}
 }
 
diff --git a/accessEntity/api_response.go b/accessEntity/api_response.go
index ac8930f..04bca8d 100644
--- a/accessEntity/api_response.go
+++ b/accessEntity/api_response.go
@@ -7,6 +7,14 @@
 	ApiProduct *ApiProductDetails `json:"apiProduct,omitempty"`
 	// Organization Identifier/Name
 	Organization string `json:"organization,omitempty"`
+	// primary identifier type
+	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
+	// primary identifier value
+	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
+	// secondary identifier type
+	SecondaryIdentifierType string `json:"secondaryIdentifierType,omitempty"`
+	// secondary identifier value
+	SecondaryIdentifierValue string `json:"secondaryIdentifierValue,omitempty"`
 }
 
 type AppCredentialSuccessResponse struct {
@@ -14,6 +22,10 @@
 	AppCredential *AppCredentialDetails `json:"appCredential,omitempty"`
 	// Organization Identifier/Name
 	Organization string `json:"organization,omitempty"`
+	// primary identifier type
+	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
+	// primary identifier value
+	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 }
 
 type AppSuccessResponse struct {
@@ -21,6 +33,14 @@
 	App *AppDetails `json:"app,omitempty"`
 	// Organization Identifier/Name
 	Organization string `json:"organization,omitempty"`
+	// primary identifier type
+	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
+	// primary identifier value
+	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
+	// secondary identifier type
+	SecondaryIdentifierType string `json:"secondaryIdentifierType,omitempty"`
+	// secondary identifier value
+	SecondaryIdentifierValue string `json:"secondaryIdentifierValue,omitempty"`
 }
 
 type CompanyDevelopersSuccessResponse struct {
@@ -28,6 +48,10 @@
 	CompanyDevelopers []*CompanyDeveloperDetails `json:"companyDevelopers"`
 	// Organization Identifier/Name
 	Organization string `json:"organization,omitempty"`
+	// primary identifier type
+	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
+	// primary identifier value
+	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 }
 
 type CompanySuccessResponse struct {
@@ -35,6 +59,10 @@
 	Company *CompanyDetails `json:"company,omitempty"`
 	// Organization Identifier/Name
 	Organization string `json:"organization,omitempty"`
+	// primary identifier type
+	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
+	// primary identifier value
+	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 }
 
 type DeveloperSuccessResponse struct {
@@ -42,71 +70,47 @@
 	Developer *DeveloperDetails `json:"developer,omitempty"`
 	// Organization Identifier/Name
 	Organization string `json:"organization,omitempty"`
+	// primary identifier type
+	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
+	// primary identifier value
+	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 }
 
 type ApiProductDetails struct {
 	// api proxies
 	ApiProxies []string `json:"apiProxies,omitempty"`
-
 	// api resources
 	ApiResources []string `json:"apiResources,omitempty"`
-
 	// approval type
 	ApprovalType string `json:"approvalType,omitempty"`
-
 	// Attributes associated with the apiproduct.
 	Attributes []common.Attribute `json:"attributes,omitempty"`
-
 	// ISO-8601
 	CreatedAt string `json:"createdAt,omitempty"`
-
 	// created by
 	CreatedBy string `json:"createdBy,omitempty"`
-
 	// description
 	Description string `json:"description,omitempty"`
-
 	// display name
 	DisplayName string `json:"displayName,omitempty"`
-
 	// environments
 	Environments []string `json:"environments,omitempty"`
-
 	// id
 	ID string `json:"id,omitempty"`
-
 	// ISO-8601
 	LastModifiedAt string `json:"lastModifiedAt,omitempty"`
-
 	// last modified by
 	LastModifiedBy string `json:"lastModifiedBy,omitempty"`
-
 	// name
 	Name string `json:"name,omitempty"`
-
-	// primary identifier type
-	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
-
-	// primary identifier value
-	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
-
 	// quota interval
 	QuotaInterval int64 `json:"quotaInterval,omitempty"`
-
 	// quota limit
 	QuotaLimit int64 `json:"quotaLimit,omitempty"`
-
 	// quota time unit
 	QuotaTimeUnit string `json:"quotaTimeUnit,omitempty"`
-
 	// scopes
 	Scopes []string `json:"scopes,omitempty"`
-
-	// secondary identifier type
-	SecondaryIdentifierType string `json:"secondaryIdentifierType,omitempty"`
-
-	// secondary identifier value
-	SecondaryIdentifierValue string `json:"secondaryIdentifierValue,omitempty"`
 }
 
 type AppDetails struct {
@@ -145,16 +149,8 @@
 	LastModifiedBy string `json:"lastModifiedBy,omitempty"`
 	// name
 	Name string `json:"name,omitempty"`
-	// primary identifier type
-	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
-	// primary identifier value
-	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 	// scopes
 	Scopes []string `json:"scopes"`
-	// secondary identifier type
-	SecondaryIdentifierType string `json:"secondaryIdentifierType,omitempty"`
-	// secondary identifier value
-	SecondaryIdentifierValue string `json:"secondaryIdentifierValue,omitempty"`
 	// status
 	Status string `json:"status,omitempty"`
 }
@@ -199,45 +195,29 @@
 	ConsumerSecret string `json:"consumerSecret,omitempty"`
 	// developer Id
 	DeveloperID string `json:"developerId,omitempty"`
-	// primary identifier type
-	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
-	// primary identifier value
-	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 	// redirect uris
 	RedirectUris []string `json:"redirectURIs"`
 	// scopes
 	Scopes []string `json:"scopes"`
-	// TODO: no secondary identifier type
-	SecondaryIdentifierType string `json:"secondaryIdentifierType,omitempty"`
-	// TODO: no secondary identifier value
-	SecondaryIdentifierValue string `json:"secondaryIdentifierValue,omitempty"`
 	// status
 	Status string `json:"status,omitempty"`
 }
 
 type ConsumerKeyStatusDetails struct {
-
 	// app credential
 	AppCredential *CredentialDetails `json:"appCredential,omitempty"`
-
 	// app Id
 	AppID string `json:"appId,omitempty"`
-
 	// app name
 	AppName string `json:"appName,omitempty"`
-
 	// app status
 	AppStatus string `json:"appStatus,omitempty"`
-
 	// app type
 	AppType string `json:"appType,omitempty"`
-
 	// developer Id
 	DeveloperID string `json:"developerId,omitempty"`
-
 	// developer status
 	DeveloperStatus string `json:"developerStatus,omitempty"`
-
 	// is valid key
 	IsValidKey string `json:"isValidKey,omitempty"`
 }
@@ -262,10 +242,6 @@
 	LastModifiedBy string `json:"lastModifiedBy,omitempty"`
 	// name
 	Name string `json:"name,omitempty"`
-	// primary identifier type
-	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
-	// primary identifier value
-	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 	// status
 	Status string `json:"status,omitempty"`
 }
@@ -283,10 +259,6 @@
 	LastModifiedAt string `json:"lastModifiedAt,omitempty"`
 	// last modified by
 	LastModifiedBy string `json:"lastModifiedBy,omitempty"`
-	// primary identifier type
-	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
-	// primary identifier value
-	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 	// roles
 	Roles []string `json:"roles"`
 }
@@ -316,10 +288,6 @@
 	LastName string `json:"lastName,omitempty"`
 	// password
 	Password string `json:"password,omitempty"`
-	// primary identifier type
-	PrimaryIdentifierType string `json:"primaryIdentifierType,omitempty"`
-	// primary identifier value
-	PrimaryIdentifierValue string `json:"primaryIdentifierValue,omitempty"`
 	// status
 	Status string `json:"status,omitempty"`
 	// user name
diff --git a/accessEntity/data_test.go b/accessEntity/data_test.go
index e836dd2..fc50947 100644
--- a/accessEntity/data_test.go
+++ b/accessEntity/data_test.go
@@ -48,33 +48,33 @@
 
 		It("should get apiProducts", func() {
 			setupTestDb(dbMan.GetDb())
-			org := "edgex01"
 			testData := [][]string{
 				//positive tests
-				{IdentifierApiProductName, "apstest", "", ""},
-				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", "", ""},
-				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", IdentifierApiResource, "/**"},
-				{IdentifierAppName, "apstest", "", ""},
-				{IdentifierConsumerKey, "abcd", "", ""},
-				{IdentifierConsumerKey, "abcd", IdentifierApiResource, "/**"},
-				{IdentifierAppName, "apstest", IdentifierDeveloperId, "e41f04e8-9d3f-470a-8bfd-c7939945896c"},
-				{IdentifierAppName, "apstest", IdentifierDeveloperEmail, "bar@google.com"},
-				{IdentifierAppName, "apstest", IdentifierCompanyName, "DevCompany"},
-				{IdentifierAppName, "apstest", IdentifierApiResource, "/**"},
+				{IdentifierApiProductName, "apstest", "", "", "apid-haoming"},
+				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", "", "", "apid-haoming"},
+				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", IdentifierApiResource, "/**", "apid-haoming"},
+				{IdentifierAppName, "apstest", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "abcd", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "abcd", IdentifierApiResource, "/**", "apid-haoming"},
+				{IdentifierAppName, "apstest", IdentifierDeveloperId, "e41f04e8-9d3f-470a-8bfd-c7939945896c", "apid-haoming"},
+				{IdentifierAppName, "apstest", IdentifierDeveloperEmail, "bar@google.com", "apid-haoming"},
+				{IdentifierAppName, "testappahhis", IdentifierCompanyName, "testcompanyhflxv", "apid-haoming"},
+				{IdentifierAppName, "apstest", IdentifierApiResource, "/**", "apid-haoming"},
 				// negative tests
-				{IdentifierApiProductName, "non-existent", "", ""},
-				{IdentifierAppId, "non-existent", "", ""},
-				{IdentifierAppId, "non-existent", IdentifierApiResource, "non-existent"},
-				{IdentifierAppName, "non-existent", "", ""},
-				{IdentifierConsumerKey, "non-existent", "", ""},
-				{IdentifierConsumerKey, "non-existent", IdentifierApiResource, "non-existent"},
-				{IdentifierAppName, "non-existent", IdentifierDeveloperId, "non-existent"},
-				{IdentifierAppName, "non-existent", IdentifierDeveloperEmail, "non-existent"},
-				{IdentifierAppName, "non-existent", IdentifierCompanyName, "non-existent"},
-				{IdentifierAppName, "non-existent", IdentifierApiResource, "non-existent"},
+				{IdentifierApiProductName, "apstest", "", "", "non-existent"},
+				{IdentifierApiProductName, "non-existent", "", "", "apid-haoming"},
+				{IdentifierAppId, "non-existent", "", "", "apid-haoming"},
+				{IdentifierAppId, "non-existent", IdentifierApiResource, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "non-existent", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "non-existent", IdentifierApiResource, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierDeveloperId, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierDeveloperEmail, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierCompanyName, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierApiResource, "non-existent", "apid-haoming"},
 			}
 
-			var expectedApiProd = common.ApiProduct{
+			var expectedDevApiProd = common.ApiProduct{
 				Id:            "b7e0970c-4677-4b05-8105-5ea59fdcf4e7",
 				Name:          "apstest",
 				DisplayName:   "apstest",
@@ -94,17 +94,38 @@
 				TenantId:      "515211e9",
 			}
 
+			var expectedComApiProd = common.ApiProduct{
+				Id:            "fea8a6d5-8d34-477f-ac82-c397eaec06af",
+				Name:          "testproductsdljnkpt",
+				DisplayName:   "testproductsdljnkpt",
+				Description:   "",
+				ApiResources:  "{/res1}",
+				ApprovalType:  "AUTO",
+				Scopes:        `{}`,
+				Proxies:       `{}`,
+				Environments:  `{test}`,
+				Quota:         "",
+				QuotaTimeUnit: "",
+				QuotaInterval: 0,
+				CreatedAt:     "2017-11-02 16:00:15.608+00:00",
+				CreatedBy:     "haoming@apid.git",
+				UpdatedAt:     "2017-11-02 16:00:18.125+00:00",
+				UpdatedBy:     "haoming@apid.git",
+				TenantId:      "515211e9",
+			}
+
 			results := [][]common.ApiProduct{
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
-				{expectedApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedDevApiProd},
+				{expectedComApiProd},
+				{expectedDevApiProd},
+				nil,
 				nil,
 				nil,
 				nil,
@@ -118,7 +139,7 @@
 			}
 
 			for i, data := range testData {
-				priKey, priVal, secKey, secVal := data[0], data[1], data[2], data[3]
+				priKey, priVal, secKey, secVal, org := data[0], data[1], data[2], data[3], data[4]
 				prods, err := dbMan.GetApiProducts(org, priKey, priVal, secKey, secVal)
 				Expect(err).Should(Succeed())
 				if len(results[i]) > 0 {
@@ -128,6 +149,245 @@
 				}
 			}
 		})
+
+		It("should get apps", func() {
+			setupTestDb(dbMan.GetDb())
+			testData := [][]string{
+				//positive tests
+				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", "", "", "apid-haoming"},
+				{IdentifierAppName, "apstest", "", "", "apid-haoming"},
+				{IdentifierAppName, "apstest", IdentifierDeveloperId, "e41f04e8-9d3f-470a-8bfd-c7939945896c", "apid-haoming"},
+				{IdentifierAppName, "apstest", IdentifierDeveloperEmail, "bar@google.com", "apid-haoming"},
+				{IdentifierAppName, "testappahhis", IdentifierCompanyName, "testcompanyhflxv", "apid-haoming"},
+				{IdentifierConsumerKey, "abcd", "", "", "apid-haoming"},
+				// negative tests
+				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", "", "", "non-existent"},
+				{IdentifierAppId, "non-existent", "", "", "apid-haoming"},
+				{IdentifierAppName, "non-existent", "", "", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierDeveloperId, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierDeveloperEmail, "non-existent", "apid-haoming"},
+				{IdentifierAppName, "non-existent", IdentifierCompanyName, "non-existent", "apid-haoming"},
+				{IdentifierConsumerKey, "non-existent", "", "", "apid-haoming"},
+			}
+
+			var expectedDevApp = common.App{
+				Id:          "408ad853-3fa0-402f-90ee-103de98d71a5",
+				TenantId:    "515211e9",
+				Name:        "apstest",
+				DisplayName: "apstest",
+				AccessType:  "READ",
+				CallbackUrl: "https://www.google.com",
+				Status:      "APPROVED",
+				AppFamily:   "default",
+				CompanyId:   "",
+				DeveloperId: "e41f04e8-9d3f-470a-8bfd-c7939945896c",
+				ParentId:    "e41f04e8-9d3f-470a-8bfd-c7939945896c",
+				Type:        "DEVELOPER",
+				CreatedAt:   "2017-08-18 22:13:18.325+00:00",
+				CreatedBy:   "haoming@apid.git",
+				UpdatedAt:   "2017-08-18 22:13:18.325+00:00",
+				UpdatedBy:   "haoming@apid.git",
+			}
+
+			var expectedComApp = common.App{
+				Id:          "35608afe-2715-4064-bb4d-3cbb4e82c474",
+				TenantId:    "515211e9",
+				Name:        "testappahhis",
+				DisplayName: "testappahhis",
+				AccessType:  "READ",
+				CallbackUrl: "",
+				Status:      "APPROVED",
+				AppFamily:   "default",
+				CompanyId:   "a94f75e2-69b0-44af-8776-155df7c7d22e",
+				DeveloperId: "",
+				ParentId:    "a94f75e2-69b0-44af-8776-155df7c7d22e",
+				Type:        "COMPANY",
+				CreatedAt:   "2017-11-02 16:00:16.504+00:00",
+				CreatedBy:   "haoming@apid.git",
+				UpdatedAt:   "2017-11-02 16:00:16.504+00:00",
+				UpdatedBy:   "haoming@apid.git",
+			}
+
+			results := [][]common.App{
+				{expectedDevApp},
+				{expectedDevApp},
+				{expectedDevApp},
+				{expectedDevApp},
+				{expectedComApp},
+				{expectedDevApp},
+				nil,
+				nil,
+				nil,
+				nil,
+				nil,
+				nil,
+				nil,
+			}
+
+			for i, data := range testData {
+				priKey, priVal, secKey, secVal, org := data[0], data[1], data[2], data[3], data[4]
+				apps, err := dbMan.GetApps(org, priKey, priVal, secKey, secVal)
+				Expect(err).Should(Succeed())
+				if len(results[i]) > 0 {
+					Expect(apps).Should(Equal(results[i]))
+				} else {
+					Expect(apps).Should(BeZero())
+				}
+			}
+		})
+
+		It("should get Companies", func() {
+			setupTestDb(dbMan.GetDb())
+			testData := [][]string{
+				//positive tests
+				{IdentifierAppId, "35608afe-2715-4064-bb4d-3cbb4e82c474", "", "", "apid-haoming"},
+				{IdentifierCompanyName, "testcompanyhflxv", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "wxyz", "", "", "apid-haoming"},
+				// negative tests
+				{IdentifierAppId, "35608afe-2715-4064-bb4d-3cbb4e82c474", "", "", "non-existent"},
+				{IdentifierAppId, "non-existent", "", "", "apid-haoming"},
+				{IdentifierCompanyName, "non-existent", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "non-existent", "", "", "apid-haoming"},
+			}
+
+			var expectedCom = common.Company{
+				Id:          "a94f75e2-69b0-44af-8776-155df7c7d22e",
+				TenantId:    "515211e9",
+				Name:        "testcompanyhflxv",
+				DisplayName: "testcompanyhflxv",
+				Status:      "ACTIVE",
+				CreatedAt:   "2017-11-02 16:00:16.287+00:00",
+				CreatedBy:   "haoming@apid.git",
+				UpdatedAt:   "2017-11-02 16:00:16.287+00:00",
+				UpdatedBy:   "haoming@apid.git",
+			}
+
+			results := [][]common.Company{
+				{expectedCom},
+				{expectedCom},
+				{expectedCom},
+				nil,
+				nil,
+				nil,
+				nil,
+			}
+
+			for i, data := range testData {
+				priKey, priVal, secKey, secVal, org := data[0], data[1], data[2], data[3], data[4]
+				apps, err := dbMan.GetCompanies(org, priKey, priVal, secKey, secVal)
+				Expect(err).Should(Succeed())
+				if len(results[i]) > 0 {
+					Expect(apps).Should(Equal(results[i]))
+				} else {
+					Expect(apps).Should(BeZero())
+				}
+			}
+		})
+
+		It("should get developers", func() {
+			setupTestDb(dbMan.GetDb())
+			testData := [][]string{
+				//positive tests
+				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "abcd", "", "", "apid-haoming"},
+				{IdentifierDeveloperEmail, "bar@google.com", "", "", "apid-haoming"},
+				{IdentifierDeveloperId, "e41f04e8-9d3f-470a-8bfd-c7939945896c", "", "", "apid-haoming"},
+
+				// negative tests
+				{IdentifierAppId, "408ad853-3fa0-402f-90ee-103de98d71a5", "", "", "non-existent"},
+				{IdentifierAppId, "non-existent", "", "", "apid-haoming"},
+				{IdentifierConsumerKey, "non-existent", "", "", "apid-haoming"},
+				{IdentifierDeveloperEmail, "non-existent", "", "", "apid-haoming"},
+				{IdentifierDeveloperId, "non-existent", "", "", "apid-haoming"},
+			}
+
+			var expectedDev = common.Developer{
+				Id:                "e41f04e8-9d3f-470a-8bfd-c7939945896c",
+				TenantId:          "515211e9",
+				UserName:          "haoming",
+				FirstName:         "haoming",
+				LastName:          "zhang",
+				Password:          "",
+				Email:             "bar@google.com",
+				Status:            "ACTIVE",
+				EncryptedPassword: "",
+				Salt:              "",
+				CreatedAt:         "2017-08-16 22:39:46.669+00:00",
+				CreatedBy:         "foo@google.com",
+				UpdatedAt:         "2017-08-16 22:39:46.669+00:00",
+				UpdatedBy:         "foo@google.com",
+			}
+
+			results := [][]common.Developer{
+				{expectedDev},
+				{expectedDev},
+				{expectedDev},
+				{expectedDev},
+				nil,
+				nil,
+				nil,
+				nil,
+				nil,
+			}
+
+			for i, data := range testData {
+				priKey, priVal, secKey, secVal, org := data[0], data[1], data[2], data[3], data[4]
+				prods, err := dbMan.GetDevelopers(org, priKey, priVal, secKey, secVal)
+				Expect(err).Should(Succeed())
+				if len(results[i]) > 0 {
+					Expect(prods).Should(Equal(results[i]))
+				} else {
+					Expect(prods).Should(BeZero())
+				}
+			}
+		})
+
+		It("should get appCredentials", func() {
+			setupTestDb(dbMan.GetDb())
+			testData := [][]string{
+				// positive tests
+				{IdentifierConsumerKey, "abcd", "", "", "apid-haoming"},
+
+				// negative tests
+				{IdentifierConsumerKey, "abcd", "", "", "non-existent"},
+				{IdentifierConsumerKey, "non-existent", "", "", "apid-haoming"},
+			}
+
+			var expectedCred = common.AppCredential{
+				Id:             "abcd",
+				TenantId:       "515211e9",
+				ConsumerSecret: "secret1",
+				AppId:          "408ad853-3fa0-402f-90ee-103de98d71a5",
+				MethodType:     "",
+				Status:         "APPROVED",
+				IssuedAt:       "2017-08-18 22:13:18.35+00:00",
+				ExpiresAt:      "",
+				AppStatus:      "",
+				Scopes:         "{}",
+				CreatedAt:      "2017-08-18 22:13:18.35+00:00",
+				CreatedBy:      "-NA-",
+				UpdatedAt:      "2017-08-18 22:13:18.352+00:00",
+				UpdatedBy:      "-NA-",
+			}
+
+			results := [][]common.AppCredential{
+				{expectedCred},
+				nil,
+				nil,
+			}
+
+			for i, data := range testData {
+				priKey, priVal, secKey, secVal, org := data[0], data[1], data[2], data[3], data[4]
+				prods, err := dbMan.GetAppCredentials(org, priKey, priVal, secKey, secVal)
+				Expect(err).Should(Succeed())
+				if len(results[i]) > 0 {
+					Expect(prods).Should(Equal(results[i]))
+				} else {
+					Expect(prods).Should(BeZero())
+				}
+			}
+		})
+
 	})
 
 })
diff --git a/accessEntity/data_test.sql b/accessEntity/data_test.sql
index 26a877b..2a41ad7 100644
--- a/accessEntity/data_test.sql
+++ b/accessEntity/data_test.sql
@@ -1,8 +1,9 @@
 PRAGMA foreign_keys=OFF;
 BEGIN TRANSACTION;
 CREATE TABLE kms_app (id text,tenant_id text,name text,display_name text,access_type text,callback_url text,status text,app_family text,company_id text,developer_id text,parent_id text,type text,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (id,tenant_id));
-INSERT INTO "kms_app" VALUES('408ad853-3fa0-402f-90ee-103de98d71a5','515211e9','apstest','','','','APPROVED','default','8ba5b747-5104-4a40-89ca-a0a51798fe34','e41f04e8-9d3f-470a-8bfd-c7939945896c','e41f04e8-9d3f-470a-8bfd-c7939945896c','DEVELOPER','2017-08-18 22:13:18.325+00:00','haoming@apid.git','2017-08-18 22:13:18.325+00:00','haoming@apid.git','515211e9');
+INSERT INTO "kms_app" VALUES('408ad853-3fa0-402f-90ee-103de98d71a5','515211e9','apstest','apstest','READ','https://www.google.com','APPROVED','default','','e41f04e8-9d3f-470a-8bfd-c7939945896c','e41f04e8-9d3f-470a-8bfd-c7939945896c','DEVELOPER','2017-08-18 22:13:18.325+00:00','haoming@apid.git','2017-08-18 22:13:18.325+00:00','haoming@apid.git','515211e9');
 INSERT INTO "kms_app" VALUES('ae053aee-f12d-4591-84ef-2e6ae0d4205d','515211e9','apigee-remote-proxy','','','','APPROVED','default','','590f33bf-f05c-48c1-bb93-183759bd9ee1','590f33bf-f05c-48c1-bb93-183759bd9ee1','DEVELOPER','2017-09-20 23:05:59.125+00:00','haoming@apid.git','2017-09-20 23:05:59.125+00:00','haoming@apid.git','515211e9');
+INSERT INTO "kms_app" VALUES('35608afe-2715-4064-bb4d-3cbb4e82c474','515211e9','testappahhis','testappahhis','READ','','APPROVED','default','a94f75e2-69b0-44af-8776-155df7c7d22e','','a94f75e2-69b0-44af-8776-155df7c7d22e','COMPANY','2017-11-02 16:00:16.504+00:00','haoming@apid.git','2017-11-02 16:00:16.504+00:00','haoming@apid.git','515211e9');
 CREATE TABLE kms_attributes (tenant_id text,entity_id text,cust_id text,org_id text,dev_id text,comp_id text,apiprdt_id text,app_id text,appcred_id text,name text,type text,value text,_change_selector text, primary key (tenant_id,entity_id,name,type));
 INSERT INTO "kms_attributes" VALUES('515211e9','e2cc4caf-40d6-4ecb-8149-ed32d04184b2','','e2cc4caf-40d6-4ecb-8149-ed32d04184b2','','','','','','features.isSmbOrganization','ORGANIZATION','false','515211e9');
 INSERT INTO "kms_attributes" VALUES('515211e9','e2cc4caf-40d6-4ecb-8149-ed32d04184b2','','e2cc4caf-40d6-4ecb-8149-ed32d04184b2','','','','','','features.mgmtGroup','ORGANIZATION','management-edgex','515211e9');
@@ -14,27 +15,32 @@
 INSERT INTO "kms_attributes" VALUES('515211e9','db90a25a-15c8-42ad-96c1-63ed9682b5a9','','','','','db90a25a-15c8-42ad-96c1-63ed9682b5a9','','','access','APIPRODUCT','public','515211e9');
 INSERT INTO "kms_attributes" VALUES('515211e9','ae053aee-f12d-4591-84ef-2e6ae0d4205d','','','','','','ae053aee-f12d-4591-84ef-2e6ae0d4205d','','DisplayName','APP','apigee-remote-proxy','515211e9');
 INSERT INTO "kms_attributes" VALUES('515211e9','ae053aee-f12d-4591-84ef-2e6ae0d4205d','','','','','','ae053aee-f12d-4591-84ef-2e6ae0d4205d','','Notes','APP','','515211e9');
+INSERT INTO "kms_attributes" VALUES('515211e9','fea8a6d5-8d34-477f-ac82-c397eaec06af','','','','','fea8a6d5-8d34-477f-ac82-c397eaec06af','','','Company','APIPRODUCT','Apigee','515211e9');
 CREATE TABLE kms_company (id text,tenant_id text,name text,display_name text,status text,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (id,tenant_id));
-INSERT INTO "kms_company" VALUES('8ba5b747-5104-4a40-89ca-a0a51798fe34','5aa3e93f','DevCompany','East India Company','ACTIVE','2017-08-15 03:29:02.449+00:00','haoming@apid.git','2017-08-15 03:29:02.449+00:00','haoming@apid.git','5aa3e93f');
+INSERT INTO "kms_company" VALUES('8ba5b747-5104-4a40-89ca-a0a51798fe34','515211e9','DevCompany','East India Company','ACTIVE','2017-08-15 03:29:02.449+00:00','haoming@apid.git','2017-08-15 03:29:02.449+00:00','haoming@apid.git','515211e9');
+INSERT INTO "kms_company" VALUES('a94f75e2-69b0-44af-8776-155df7c7d22e','515211e9','testcompanyhflxv','testcompanyhflxv','ACTIVE','2017-11-02 16:00:16.287+00:00','haoming@apid.git','2017-11-02 16:00:16.287+00:00','haoming@apid.git','515211e9');
 CREATE TABLE kms_company_developer (tenant_id text,company_id text,developer_id text,roles text,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (tenant_id,company_id,developer_id));
 CREATE TABLE kms_developer (id text,tenant_id text,username text,first_name text,last_name text,password text,email text,status text,encrypted_password text,salt text,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (id,tenant_id));
 INSERT INTO "kms_developer" VALUES('e41f04e8-9d3f-470a-8bfd-c7939945896c','515211e9','haoming','haoming','zhang','','bar@google.com','ACTIVE','','','2017-08-16 22:39:46.669+00:00','foo@google.com','2017-08-16 22:39:46.669+00:00','foo@google.com','515211e9');
 INSERT INTO "kms_developer" VALUES('47d862db-884f-4b8e-9649-fe6d0be1a739','515211e9','qwe','qwe','qwe','','barfoo@google.com','ACTIVE','','','2017-10-12 19:12:48.306+00:00','haoming@apid.git','2017-10-12 19:12:48.306+00:00','haoming@apid.git','515211e9');
 INSERT INTO "kms_developer" VALUES('590f33bf-f05c-48c1-bb93-183759bd9ee1','515211e9','remoteproxy','remote','proxy','','fooo@google.com','ACTIVE','','','2017-09-20 23:03:52.327+00:00','haoming@apid.git','2017-09-20 23:03:52.327+00:00','haoming@apid.git','515211e9');
 CREATE TABLE edgex_apid_cluster (id text,name text,description text,umbrella_org_app_name text,created blob,created_by text,updated blob,updated_by text,_change_selector text, last_sequence text DEFAULT '', primary key (id));
-INSERT INTO "edgex_apid_cluster" VALUES('950b30f1-8c41-4bf5-94a3-f10c104ff5d4','edgex01OrgCluster','','X-sZXhaOymL6VtWnNQqK7uPsFyPvZYq6FFnrc8','2017-08-23 23:31:49.134+00:00','temp@google.com','2017-08-23 23:31:49.134+00:00','temp@google.com','950b30f1-8c41-4bf5-94a3-f10c104ff5d4','');
+INSERT INTO "edgex_apid_cluster" VALUES('950b30f1-8c41-4bf5-94a3-f10c104ff5d4','apid-haomingOrgCluster','','X-sZXhaOymL6VtWnNQqK7uPsFyPvZYq6FFnrc8','2017-08-23 23:31:49.134+00:00','temp@google.com','2017-08-23 23:31:49.134+00:00','temp@google.com','950b30f1-8c41-4bf5-94a3-f10c104ff5d4','');
 CREATE TABLE kms_api_product (id text,tenant_id text,name text,display_name text,description text,api_resources text,approval_type text,scopes text,proxies text,environments text,quota text,quota_time_unit text,quota_interval integer,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (id,tenant_id));
 INSERT INTO "kms_api_product" VALUES('b7e0970c-4677-4b05-8105-5ea59fdcf4e7','515211e9','apstest','apstest','','{/**}','AUTO','{""}','{aps,perfBenchmark}','{prod,test}','10000000','MINUTE',1,'2017-08-18 22:12:49.363+00:00','haoming@apid.git','2017-08-18 22:26:50.153+00:00','haoming@apid.git','515211e9');
 INSERT INTO "kms_api_product" VALUES('8501392f-c5f7-4d6a-8841-e038ad5913b4','515211e9','ApigeenTestApp','ApigeenTestApp','','{/}','AUTO','{scope1,scope2,scope3}','{}','{prod,test}','','',NULL,'2017-09-20 22:29:06.451+00:00','haoming@apid.git','2017-09-20 22:29:06.451+00:00','haoming@apid.git','515211e9');
 INSERT INTO "kms_api_product" VALUES('e4ae89d0-ea47-4b23-b0dc-2723efb15c84','515211e9','ApigeenTestApp2','ApigeenTestApp2','','{/}','AUTO','{scope1,scope2,scope3}','{}','{prod,test}','','',NULL,'2017-09-20 22:29:08.988+00:00','haoming@apid.git','2017-09-20 22:29:08.988+00:00','haoming@apid.git','515211e9');
 INSERT INTO "kms_api_product" VALUES('07419482-e5a1-4fd0-9d78-3560ba522b44','515211e9','ApigeenTestApp3','ApigeenTestApp3','','{/}','AUTO','{}','{}','{prod,test}','','',NULL,'2017-09-20 22:29:11.482+00:00','haoming@apid.git','2017-09-20 22:29:11.482+00:00','haoming@apid.git','515211e9');
 INSERT INTO "kms_api_product" VALUES('db90a25a-15c8-42ad-96c1-63ed9682b5a9','515211e9','apigee-remote-proxy','apigee-remote-proxy','','{/**,/}','AUTO','{""}','{apigee-remote-proxy}','{prod,test}','','',NULL,'2017-09-20 23:05:09.234+00:00','haoming@apid.git','2017-09-20 23:05:09.234+00:00','haoming@apid.git','515211e9');
+INSERT INTO "kms_api_product" VALUES('fea8a6d5-8d34-477f-ac82-c397eaec06af','515211e9','testproductsdljnkpt','testproductsdljnkpt','','{/res1}','AUTO','{}','{}','{test}','','',NULL,'2017-11-02 16:00:15.608+00:00','haoming@apid.git','2017-11-02 16:00:18.125+00:00','haoming@apid.git','515211e9');
 CREATE TABLE kms_app_credential (id text,tenant_id text,consumer_secret text,app_id text,method_type text,status text,issued_at blob,expires_at blob,app_status text,scopes text,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (id,tenant_id));
 INSERT INTO "kms_app_credential" VALUES('abcd','515211e9','secret1','408ad853-3fa0-402f-90ee-103de98d71a5','','APPROVED','2017-08-18 22:13:18.35+00:00','','','{}','2017-08-18 22:13:18.35+00:00','-NA-','2017-08-18 22:13:18.352+00:00','-NA-','515211e9');
 INSERT INTO "kms_app_credential" VALUES('dcba','515211e9','secret2','ae053aee-f12d-4591-84ef-2e6ae0d4205d','','APPROVED','2017-09-20 23:05:59.148+00:00','','','{}','2017-09-20 23:05:59.148+00:00','-NA-','2017-09-20 23:05:59.151+00:00','-NA-','515211e9');
+INSERT INTO "kms_app_credential" VALUES('wxyz','515211e9','secret3','35608afe-2715-4064-bb4d-3cbb4e82c474','','APPROVED','2017-11-02 16:00:16.512+00:00','','','{}','2017-11-02 16:00:16.512+00:00','-NA-','2017-11-02 16:00:16.514+00:00','-NA-','515211e9');
 CREATE TABLE kms_app_credential_apiproduct_mapper (tenant_id text,appcred_id text,app_id text,apiprdt_id text,status text,_change_selector text, primary key (tenant_id,appcred_id,app_id,apiprdt_id));
 INSERT INTO "kms_app_credential_apiproduct_mapper" VALUES('515211e9','abcd','408ad853-3fa0-402f-90ee-103de98d71a5','b7e0970c-4677-4b05-8105-5ea59fdcf4e7','APPROVED','515211e9');
 INSERT INTO "kms_app_credential_apiproduct_mapper" VALUES('515211e9','dcba','ae053aee-f12d-4591-84ef-2e6ae0d4205d','db90a25a-15c8-42ad-96c1-63ed9682b5a9','APPROVED','515211e9');
+INSERT INTO "kms_app_credential_apiproduct_mapper" VALUES('515211e9','wxyz','35608afe-2715-4064-bb4d-3cbb4e82c474','fea8a6d5-8d34-477f-ac82-c397eaec06af','APPROVED','515211e9');
 CREATE TABLE kms_organization (id text,name text,display_name text,type text,tenant_id text,customer_id text,description text,created_at blob,created_by text,updated_at blob,updated_by text,_change_selector text, primary key (id,tenant_id));
-INSERT INTO "kms_organization" VALUES('e2cc4caf-40d6-4ecb-8149-ed32d04184b2','edgex01','edgex01','paid','515211e9','94cd5075-7f33-4afb-9545-a53a254277a1','','2017-08-16 22:16:06.544+00:00','foobar@google.com','2017-08-16 22:29:23.046+00:00','foobar@google.com','515211e9');
+INSERT INTO "kms_organization" VALUES('e2cc4caf-40d6-4ecb-8149-ed32d04184b2','apid-haoming','apid-haoming','paid','515211e9','94cd5075-7f33-4afb-9545-a53a254277a1','','2017-08-16 22:16:06.544+00:00','foobar@google.com','2017-08-16 22:29:23.046+00:00','foobar@google.com','515211e9');
 COMMIT;
diff --git a/accessEntity/interfaces.go b/accessEntity/interfaces.go
index 94506ec..e77c981 100644
--- a/accessEntity/interfaces.go
+++ b/accessEntity/interfaces.go
@@ -18,6 +18,7 @@
 	GetCompanyDevelopers(org, priKey, priVal, secKey, secVal string) (companyDevelopers []common.CompanyDeveloper, err error)
 	GetAppCredentials(org, priKey, priVal, secKey, secVal string) (appCredentials []common.AppCredential, err error)
 	GetDevelopers(org, priKey, priVal, secKey, secVal string) (developers []common.Developer, err error)
+	// utils
 	GetApiProductNamesByAppId(appId string) ([]string, error)
 	GetAppNamesByComId(comId string) ([]string, error)
 	GetComNamesByDevId(devId string) ([]string, error)