diff --git a/src/main/java/org/onap/dmaap/dbcapi/model/ApiError.java b/src/main/java/org/onap/dmaap/dbcapi/model/ApiError.java
index 8d8e23f..2e05740 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/model/ApiError.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/model/ApiError.java
@@ -21,13 +21,28 @@
 package org.onap.dmaap.dbcapi.model;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Objects;
 
 @XmlRootElement
 public class ApiError {
 	private int code;
 	private String message;
 	private String fields;
-	
+
+	public ApiError() {
+		this(0, null, null);
+	}
+
+	public ApiError(int code, String message) {
+		this(code, message, null);
+	}
+
+	public ApiError(int code, String message, String fields) {
+		this.code = code;
+		this.message = message;
+		this.fields = fields;
+	}
+
 	public int getCode() {
 		return code;
 	}
@@ -58,4 +73,19 @@
 		message = null;
 		fields = null;
 	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+		ApiError apiError = (ApiError) o;
+		return code == apiError.code &&
+				Objects.equals(message, apiError.message) &&
+				Objects.equals(fields, apiError.fields);
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(code, message, fields);
+	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java b/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java
index 9dafb55..fd5b4aa 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java
@@ -20,8 +20,6 @@
 
 package org.onap.dmaap.dbcapi.resources;
 
-import java.io.IOException;
-
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerRequestFilter;
 
@@ -34,29 +32,26 @@
 public class AuthorizationFilter implements ContainerRequestFilter   {
 	
 	private Logger logger = Logger.getLogger(AuthorizationFilter.class.getName());
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	@Override
-	public void filter(ContainerRequestContext requestContext)
-			throws IOException {
+	public void filter(ContainerRequestContext requestContext) {
 
 		ApiService apiResp = new ApiService()
 			.setAuth( requestContext.getHeaderString("Authorization") )
 			.setUriPath(requestContext.getUriInfo().getPath())
 			.setHttpMethod( requestContext.getMethod() )
 			.setRequestId( requestContext.getHeaderString("X-ECOMP-RequestID") );
-		
+
 		try {
 			apiResp.checkAuthorization();
 		} catch ( AuthenticationErrorException ae ) {
 			logger.error("Error", ae);
-			requestContext.abortWith( apiResp.unauthorized( apiResp.getErr().getMessage() ) );
-			return ;
+			requestContext.abortWith( responseBuilder.unauthorized( apiResp.getErr().getMessage() ) );
 		} catch ( Exception e ) {
 			logger.error("Error", e);
-			requestContext.abortWith( apiResp.unavailable() ); 
-			return;
+			requestContext.abortWith( responseBuilder.unavailable() );
 		}
-		
 
 	}
 
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java
index 192b63d..299c48f 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/BridgeResource.java
@@ -32,13 +32,11 @@
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.BrTopic;
 import org.onap.dmaap.dbcapi.model.MirrorMaker;
-import org.onap.dmaap.dbcapi.service.ApiService;
 import org.onap.dmaap.dbcapi.service.MirrorMakerService;
 
 import io.swagger.annotations.Api;
@@ -46,6 +44,8 @@
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 
+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
+
 @Path("/bridge")
 @Api( value= "bridge", description = "Endpoint for retreiving MR Bridge metrics" )
 @Consumes(MediaType.APPLICATION_JSON)
@@ -54,6 +54,7 @@
 public class BridgeResource extends BaseLoggingClass {
 	
 	private MirrorMakerService mmService = new MirrorMakerService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 
 	@GET
 	@ApiOperation( value = "return BrTopic details", 
@@ -66,10 +67,9 @@
 })
 	public Response	getBridgedTopics(@QueryParam("mmagent") String mmagent,
 						   			@QueryParam("detail") Boolean detailFlag ){
-		ApiService check = new ApiService();
-		
+
 		if ( mmagent == null ) {
-			return check.success(getMMcounts(Boolean.TRUE.equals(detailFlag)));
+			return responseBuilder.success(getMMcounts(Boolean.TRUE.equals(detailFlag)));
 
 		}
 		logger.info( "getBridgeTopics():" + " mmagent=" + mmagent);
@@ -81,7 +81,7 @@
 
 			MirrorMaker mm = mmService.getMirrorMaker(mmagent);
 			if ( mm == null ) {		
-				return check.notFound();
+				return responseBuilder.notFound();
 			} 
 					
 			brTopic.setTopicCount( mm.getTopicCount() );
@@ -91,16 +91,16 @@
 			
 			logger.info( "topicCount [2 locations]: " + brTopic.getTopicCount() );
 		
-			return check.success(brTopic);
+			return responseBuilder.success(brTopic);
 		} else {	
 			logger.info( "getBridgeTopics() detail:" + " mmagent=" + mmagent);
 			// get topics between 2 bridged locations	
 			MirrorMaker mm = mmService.getMirrorMaker(mmagent);
 			if ( mm == null ) {		
-				return check.notFound();
+				return responseBuilder.notFound();
 			} 
 
-			return check.success(mm);
+			return responseBuilder.success(mm);
 		}
 	}
 	
@@ -156,15 +156,13 @@
 						   			@QueryParam("refresh") Boolean refreshFlag,
 						   			@QueryParam("split") Boolean splitFlag,
 						   			MirrorMaker newBridge ){
-		ApiService check = new ApiService();	
-			
 		logger.info( "putBridgeTopics() mmagent:" +  mmagent );
 
 		if ( mmagent != null ) {		// put topics between 2 bridged locations
 			
 			MirrorMaker mm = mmService.getMirrorMaker(mmagent);
 			if ( mm == null ) {		
-				return check.notFound();
+				return responseBuilder.notFound();
 			} 
 			
 			if ( splitFlag != null && splitFlag == true ) {
@@ -173,24 +171,20 @@
 				logger.info( "setting whitelist from message body containing mmName=" + newBridge.getMmName());
 				if ( ! mmagent.equals(newBridge.getMmName()) ){
 					logger.error( "mmagent query param does not match mmName in body");
-					check.setCode(Status.BAD_REQUEST.getStatusCode());
-					check.setMessage("mmagent query param does not match mmName in body");
-					return check.error();
+					return responseBuilder.error(new ApiError(BAD_REQUEST.getStatusCode(),
+							"mmagent query param does not match mmName in body"));
 				}
 				mm.setTopics( newBridge.getTopics() );
 			} else {
 				logger.info( "refreshing whitelist from memory");
 			}
 			mmService.updateMirrorMaker(mm);
-			return check.success(mm);
+			return responseBuilder.success(mm);
 		}
 
 		else {
-
 			logger.error( "mmagent is required for PUT");
-			check.setCode(Status.BAD_REQUEST.getStatusCode());
-			check.setMessage("mmagent is required for PUT");
-			return check.error();
+			return responseBuilder.error(new ApiError(BAD_REQUEST.getStatusCode(), "mmagent is required for PUT"));
 		}
 
 	}
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_NodeResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_NodeResource.java
index 8091ac3..029222e 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_NodeResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_NodeResource.java
@@ -38,7 +38,6 @@
 import javax.ws.rs.core.GenericEntity;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.model.ApiError;
@@ -46,6 +45,9 @@
 import org.onap.dmaap.dbcapi.service.ApiService;
 import org.onap.dmaap.dbcapi.service.DR_NodeService;
 
+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
+import static javax.ws.rs.core.Response.Status.NO_CONTENT;
+
 @Path("/dr_nodes")
 @Api( value= "dr_nodes", description = "Endpoint for a Data Router Node server" )
 @Consumes(MediaType.APPLICATION_JSON)
@@ -53,7 +55,8 @@
 @Authorization
 public class DR_NodeResource extends BaseLoggingClass {
 
-	DR_NodeService dr_nodeService = new DR_NodeService();
+	private DR_NodeService dr_nodeService = new DR_NodeService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	@GET
 	@ApiOperation( value = "return DR_Node details", 
@@ -64,13 +67,11 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response getDr_Nodes() {
-		ApiService resp = new ApiService();
-
 		List<DR_Node> nodes = dr_nodeService.getAllDr_Nodes();
 
 		GenericEntity<List<DR_Node>> list = new GenericEntity<List<DR_Node>>(nodes) {
         };
-        return resp.success(list);
+        return responseBuilder.success(list);
 	}
 	
 	@POST
@@ -90,17 +91,14 @@
 			resp.required( "dcaeLocation", node.getDcaeLocationName(), "");
 			resp.required( "fqdn", node.getFqdn(), "");
 		} catch ( RequiredFieldException rfe ) {
-			resp.setCode(Status.BAD_REQUEST.getStatusCode());
-			resp.setMessage("missing required field");
-			resp.setFields("dcaeLocation, fqdn");
-			
-			return resp.error();
+			return responseBuilder.error(new ApiError(BAD_REQUEST.getStatusCode(),
+					"missing required field", "dcaeLocation, fqdn"));
 		}
 		DR_Node nNode = dr_nodeService.addDr_Node(node, resp.getErr());
 		if ( resp.getErr().is2xx()) {
-			return resp.success(nNode);
+			return responseBuilder.success(nNode);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 	
 	@PUT
@@ -122,14 +120,14 @@
 			resp.required( "dcaeLocation", name, "");
 			resp.required( "fqdn", node.getFqdn(), "");
 		} catch ( RequiredFieldException rfe ) {
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		node.setFqdn(name);
 		DR_Node nNode = dr_nodeService.updateDr_Node(node, resp.getErr());
 		if ( resp.getErr().is2xx()) {
-			return resp.success(nNode);
+			return responseBuilder.success(nNode);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 	
 	@DELETE
@@ -151,13 +149,13 @@
 			resp.required( "fqdn", name, "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		dr_nodeService.removeDr_Node(name, resp.getErr());
 		if ( resp.getErr().is2xx() ) {
-			return resp.success(Status.NO_CONTENT.getStatusCode(), null);
+			return responseBuilder.success(NO_CONTENT.getStatusCode(), null);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 
 	@GET
@@ -176,8 +174,8 @@
 
 		DR_Node nNode = dr_nodeService.getDr_Node( name, resp.getErr() );
 		if ( resp.getErr().is2xx() ) {
-			return resp.success(nNode);
+			return responseBuilder.success(nNode);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_PubResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_PubResource.java
index 1673857..9c2ae21 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_PubResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_PubResource.java
@@ -58,7 +58,8 @@
 @Authorization
 public class DR_PubResource extends BaseLoggingClass {
 
-	DR_PubService dr_pubService = new DR_PubService();
+	private DR_PubService dr_pubService = new DR_PubService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	@GET
 	@ApiOperation( value = "return DR_Pub details", 
@@ -69,14 +70,12 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public  Response getDr_Pubs() {
-		ApiService resp = new ApiService();
-
 		logger.info( "Entry: GET /dr_pubs");
 		List<DR_Pub> pubs = dr_pubService.getAllDr_Pubs();
 
 		GenericEntity<List<DR_Pub>> list = new GenericEntity<List<DR_Pub>>(pubs) {
         };
-        return resp.success(list);
+        return responseBuilder.success(list);
 	}
 	
 	@POST
@@ -103,13 +102,13 @@
 				resp.required( "feedName", pub.getFeedName(), "");
 			}catch ( RequiredFieldException rfe2 ) {
 				logger.debug( resp.toString() );
-				return resp.error();
+				return responseBuilder.error(resp.getErr());
 			}
 			// if we found a FeedName instead of a FeedId then try to look it up.
 			List<Feed> nfeeds =  feeds.getAllFeeds( pub.getFeedName(), pub.getFeedVersion(), "equals");
 			if ( nfeeds.size() != 1 ) {
 				logger.debug( "Attempt to match "+ pub.getFeedName() + " ver="+pub.getFeedVersion() + " matched " + nfeeds.size() );
-				return resp.error();
+				return responseBuilder.error(resp.getErr());
 			}
 			fnew = nfeeds.get(0);
 		}
@@ -117,7 +116,7 @@
 			resp.required( "dcaeLocationName", pub.getDcaeLocationName(), "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.getErr().toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 
 
@@ -127,7 +126,7 @@
 		}
 		if ( fnew == null ) {
 			logger.info( "Specified feed " + pub.getFeedId() + " or " + pub.getFeedName() + " not known to Bus Controller");	
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 
 		ArrayList<DR_Pub> pubs = fnew.getPubs();
@@ -146,13 +145,13 @@
 		fnew = feeds.updateFeed( fnew, resp.getErr() );	
 		
 		if ( ! resp.getErr().is2xx()) {	
-			return resp.error();			
+			return responseBuilder.error(resp.getErr());
 		}
 		pubs = fnew.getPubs();
 		logger.info( "num existing pubs after = " + pubs.size() );
 		
 		DR_Pub pnew = dr_pubService.getDr_Pub(pub.getPubId(), resp.getErr());
-		return resp.success(Status.CREATED.getStatusCode(), pnew);
+		return responseBuilder.success(Status.CREATED.getStatusCode(), pnew);
 	}
 	
 	@PUT
@@ -168,12 +167,10 @@
 			@PathParam("pubId") String name, 
 			DR_Pub pub
 			) {
-		ApiService resp = new ApiService();
-
 		logger.info( "Entry: PUT /dr_pubs");
 		pub.setPubId(name);
 		DR_Pub res = dr_pubService.updateDr_Pub(pub);
-		return resp.success(res);
+		return responseBuilder.success(res);
 	}
 	
 	@DELETE
@@ -194,24 +191,24 @@
 		try {
 			resp.required( "pubId", id, "");
 		} catch ( RequiredFieldException rfe ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 
 		DR_Pub pub =  dr_pubService.getDr_Pub( id, resp.getErr() );
 		if ( ! resp.getErr().is2xx()) {	
-			return resp.error();					
+			return responseBuilder.error(resp.getErr());
 		}
 		FeedService feeds = new FeedService();
 		Feed fnew = feeds.getFeed( pub.getFeedId(), resp.getErr() );
 		if ( fnew == null ) {
 			logger.info( "Specified feed " + pub.getFeedId() + " not known to Bus Controller");	
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		ArrayList<DR_Pub> pubs = fnew.getPubs();
 		if ( pubs.size() == 1 ) {
 			resp.setCode(Status.BAD_REQUEST.getStatusCode());
 			resp.setMessage( "Can't delete the last publisher of a feed");
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		
 		for( Iterator<DR_Pub> i = pubs.iterator(); i.hasNext(); ) {
@@ -223,14 +220,14 @@
 		fnew.setPubs(pubs);
 		fnew = feeds.updateFeed( fnew, resp.getErr() );
 		if ( ! resp.getErr().is2xx()) {	
-			return resp.error();			
+			return responseBuilder.error(resp.getErr());
 		}
 		
 		dr_pubService.removeDr_Pub(id, resp.getErr() );
 		if ( ! resp.getErr().is2xx()) {	
-			return resp.error();		
+			return responseBuilder.error(resp.getErr());
 		}
-		return resp.success(Status.NO_CONTENT.getStatusCode(), null);
+		return responseBuilder.success(Status.NO_CONTENT.getStatusCode(), null);
 	}
 
 	@GET
@@ -250,13 +247,13 @@
 		try {
 			resp.required( "feedId", id, "");
 		} catch ( RequiredFieldException rfe ) {
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 
 		DR_Pub pub =  dr_pubService.getDr_Pub( id, resp.getErr() );
 		if ( ! resp.getErr().is2xx()) {	
 			resp.getErr();			
 		}
-		return resp.success(Status.OK.getStatusCode(), pub);
+		return responseBuilder.success(Status.OK.getStatusCode(), pub);
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java
index 498454e..01ac059 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/DR_SubResource.java
@@ -51,6 +51,8 @@
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 
+import static javax.ws.rs.core.Response.Status.CREATED;
+
 
 @Path("/dr_subs")
 @Api( value= "dr_subs", description = "Endpoint for a Data Router client that implements a Subscriber" )
@@ -58,6 +60,8 @@
 @Produces(MediaType.APPLICATION_JSON)
 @Authorization
 public class DR_SubResource extends BaseLoggingClass {
+
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 		
 	@GET
 	@ApiOperation( value = "return DR_Sub details", 
@@ -68,15 +72,12 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response getDr_Subs() {
-
-		ApiService resp = new ApiService();
-
 		DR_SubService dr_subService = new DR_SubService();
 		List<DR_Sub> subs = dr_subService.getAllDr_Subs();
 
 		GenericEntity<List<DR_Sub>> list = new GenericEntity<List<DR_Sub>>(subs) {
         };
-        return resp.success(list);
+        return responseBuilder.success(list);
 	}
 		
 	@POST
@@ -101,13 +102,13 @@
 				resp.required( "feedName", sub.getFeedName(), "");
 			}catch ( RequiredFieldException rfe2 ) {
 				logger.debug( resp.toString() );
-				return resp.error();
+				return responseBuilder.error(resp.getErr());
 			}
 			// if we found a FeedName instead of a FeedId then try to look it up.
 			List<Feed> nfeeds =  feeds.getAllFeeds( sub.getFeedName(), sub.getFeedVersion(), "equals");
 			if ( nfeeds.size() != 1 ) {
 				logger.debug( "Attempt to match "+ sub.getFeedName() + " ver="+sub.getFeedVersion() + " matched " + nfeeds.size() );
-				return resp.error();
+				return responseBuilder.error(resp.getErr());
 			}
 			fnew = nfeeds.get(0);
 		}
@@ -116,7 +117,7 @@
 			resp.required( "dcaeLocationName", sub.getDcaeLocationName(), "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		// we may have fnew already if located by FeedName
 		if ( fnew == null ) {
@@ -125,21 +126,21 @@
 		if ( fnew == null ) {
 			logger.warn( "Specified feed " + sub.getFeedId() + " or " + sub.getFeedName() + " not known to Bus Controller");
 			resp.setCode(Status.NOT_FOUND.getStatusCode());
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		DR_SubService dr_subService = new DR_SubService( fnew.getSubscribeURL());
 		ArrayList<DR_Sub> subs = fnew.getSubs();
 		logger.info( "num existing subs before = " + subs.size() );
 		DR_Sub snew = dr_subService.addDr_Sub(sub, resp.getErr() );
 		if ( ! resp.getErr().is2xx() ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		subs.add( snew );
 		logger.info( "num existing subs after = " + subs.size() );
 		
 		fnew.setSubs(subs);
 		logger.info( "update feed");
-		return resp.success(Status.CREATED.getStatusCode(), snew);
+		return responseBuilder.success(CREATED.getStatusCode(), snew);
 
 	}
 		
@@ -166,22 +167,22 @@
 	
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		FeedService feeds = new FeedService();
 		Feed fnew = feeds.getFeed( sub.getFeedId(), resp.getErr() );
 		if ( fnew == null ) {
 			logger.warn( "Specified feed " + sub.getFeedId() + " not known to Bus Controller");
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 
 		DR_SubService dr_subService = new DR_SubService();
 		sub.setSubId(name);
 		DR_Sub nsub = dr_subService.updateDr_Sub(sub, resp.getErr() );
 		if ( nsub != null && nsub.isStatusValid() ) {
-			return resp.success(nsub);
+			return responseBuilder.success(nsub);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 		
 	@DELETE
@@ -203,14 +204,14 @@
 			resp.required( "subId", id, "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		DR_SubService dr_subService = new DR_SubService();
 		dr_subService.removeDr_Sub(id, resp.getErr() );
 		if ( ! resp.getErr().is2xx() ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
-		return resp.success(Status.NO_CONTENT.getStatusCode(), null );
+		return responseBuilder.success(Status.NO_CONTENT.getStatusCode(), null );
 	}
 
 	@GET
@@ -231,13 +232,13 @@
 			resp.required( "subId", id, "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		DR_SubService dr_subService = new DR_SubService();
 		DR_Sub sub =  dr_subService.getDr_Sub( id, resp.getErr() );
 		if ( sub != null && sub.isStatusValid() ) {
-			return resp.success(sub);
+			return responseBuilder.success(sub);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/DcaeLocationResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/DcaeLocationResource.java
index 8cb5336..89c9b49 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/DcaeLocationResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/DcaeLocationResource.java
@@ -41,13 +41,14 @@
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.log4j.Logger;
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.DcaeLocation;
-import org.onap.dmaap.dbcapi.service.ApiService;
 import org.onap.dmaap.dbcapi.service.DcaeLocationService;
 
+import static javax.ws.rs.core.Response.Status.NOT_FOUND;
+import static javax.ws.rs.core.Response.Status.NO_CONTENT;
+
 
 @Path("/dcaeLocations")
 @Api( value= "dcaeLocations", description = "an OpenStack tenant purposed for OpenDCAE (i.e. where OpenDCAE components might be deployed)" )
@@ -55,8 +56,8 @@
 @Produces(MediaType.APPLICATION_JSON)
 @Authorization
 public class DcaeLocationResource extends BaseLoggingClass {
-	static final Logger logger = Logger.getLogger(DcaeLocationResource.class);	
-	DcaeLocationService locationService = new DcaeLocationService();
+	private DcaeLocationService locationService = new DcaeLocationService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	@GET
 	@ApiOperation( value = "return dcaeLocation details", 
@@ -67,13 +68,10 @@
         @ApiResponse( code = 400, message = "Error", response = ApiError.class )
     })
 	public Response getDcaeLocations() {
-		ApiService check = new ApiService();
-
 		List<DcaeLocation> locs = locationService.getAllDcaeLocations();
 
-		GenericEntity<List<DcaeLocation>> list = new GenericEntity<List<DcaeLocation>>(locs) {
-        };
-        return check.success(list);
+		GenericEntity<List<DcaeLocation>> list = new GenericEntity<List<DcaeLocation>>(locs) {};
+        return responseBuilder.success(list);
 	}
 	
 	@POST
@@ -84,22 +82,14 @@
         @ApiResponse( code = 200, message = "Success", response = DcaeLocation.class),
         @ApiResponse( code = 400, message = "Error", response = ApiError.class )
     })
-	public Response addDcaeLocation( 
-			DcaeLocation location 
-			) {
-		ApiService check = new ApiService();
+	public Response addDcaeLocation(DcaeLocation location) {
 
 		if ( locationService.getDcaeLocation(location.getDcaeLocationName()) != null ) {
-				
-			check.setCode(Status.CONFLICT.getStatusCode());
-			check.setMessage("dcaeLocation already exists");
-			check.setFields("dcaeLocation");
-			
-			return check.error();
-
+			return responseBuilder.error(new ApiError(Status.CONFLICT.getStatusCode(),
+					"dcaeLocation already exists", "dcaeLocation"));
 		}
 		DcaeLocation loc = locationService.addDcaeLocation(location);
-		return check.success(Status.CREATED.getStatusCode(), loc);
+		return responseBuilder.success(Status.CREATED.getStatusCode(), loc);
 	}
 	
 	@PUT
@@ -112,25 +102,15 @@
     })
 	@Path("/{locationName}")
 	public Response updateDcaeLocation( 
-			@PathParam("locationName") String name, 
-			DcaeLocation location
-			 ) {
-		ApiService check = new ApiService();
+			@PathParam("locationName") String name, DcaeLocation location) {
 
 		location.setDcaeLocationName(name);
 		if ( locationService.getDcaeLocation(location.getDcaeLocationName()) == null ) {
-			ApiError err = new ApiError();
-				
-			err.setCode(Status.NOT_FOUND.getStatusCode());
-			err.setMessage("dcaeLocation does not exist");
-			err.setFields("dcaeLocation");
-			
-			return check.notFound();
-
+			return responseBuilder.notFound();
 
 		}
 		DcaeLocation loc = locationService.updateDcaeLocation(location);
-		return check.success(Status.CREATED.getStatusCode(), loc );
+		return responseBuilder.success(Status.CREATED.getStatusCode(), loc );
 	}
 	
 	@DELETE
@@ -143,10 +123,8 @@
 	public Response deleteDcaeLocation( 
 			@PathParam("locationName") String name
 			 ){
-		ApiService check = new ApiService();
-
 		locationService.removeDcaeLocation(name);
-		return check.success(Status.NO_CONTENT.getStatusCode(), null);
+		return responseBuilder.success(NO_CONTENT.getStatusCode(), null);
 	}
 
 	@GET
@@ -157,23 +135,19 @@
     })
 	@Path("/{locationName}")
 	public Response getDcaeLocation( 
-			@PathParam("locationName") String name
-			 ) {
-		ApiService check = new ApiService();
+			@PathParam("locationName") String name) {
 
 		DcaeLocation loc =  locationService.getDcaeLocation( name );
 		if ( loc == null ) {
 			ApiError err = new ApiError();
 				
-			err.setCode(Status.NOT_FOUND.getStatusCode());
+			err.setCode(NOT_FOUND.getStatusCode());
 			err.setMessage("dcaeLocation does not exist");
 			err.setFields("dcaeLocation");
 			
-			return check.error();
-
-
+			return responseBuilder.error(err);
 		}
 
-		return check.success(loc);
+		return responseBuilder.success(loc);
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/DmaapResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/DmaapResource.java
index bd30055..d7fb507 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/DmaapResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/DmaapResource.java
@@ -57,7 +57,8 @@
 public class DmaapResource extends BaseLoggingClass {
 
 
-	DmaapService dmaapService = new DmaapService();
+	private DmaapService dmaapService = new DmaapService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	@GET
 	@ApiOperation( value = "return dmaap details", notes = "returns the `dmaap` object, which contains system wide configuration settings", response = Dmaap.class)
@@ -67,10 +68,8 @@
     })
 
 	public Response getDmaap(@Context UriInfo uriInfo)  {
-		ApiService check = new ApiService();
-			
 		Dmaap d =  dmaapService.getDmaap();
-		return check.success(d);
+		return responseBuilder.success(d);
 	}
 	
 	@POST
@@ -88,16 +87,16 @@
 			check.required( "topicNsRoot", obj.getTopicNsRoot(), "" );
 			check.required( "bridgeAdminTopic", obj.getBridgeAdminTopic(), "" );
 		} catch( RequiredFieldException rfe ) {
-			return check.error();
+			return responseBuilder.error(check.getErr());
 		}
 	
 		Dmaap d =  dmaapService.addDmaap(obj);
 		if ( d == null ) {
-			return check.notFound();
+			return responseBuilder.notFound();
 
 		} 
 
-		return check.success(d);
+		return responseBuilder.success(d);
 	}
 	
 	@PUT
@@ -115,13 +114,13 @@
 			check.required( "topicNsRoot", obj.getTopicNsRoot(), "" );
 			check.required( "bridgeAdminTopic", obj.getBridgeAdminTopic(), "" );
 		} catch( RequiredFieldException rfe ) {
-			return check.error();
+			return responseBuilder.error(check.getErr());
 		}
 		Dmaap d =  dmaapService.updateDmaap(obj);
 		if ( d != null ) {
-			return check.success(d);
+			return responseBuilder.success(d);
 		} else {
-			return check.notFound();	
+			return responseBuilder.notFound();
 		}	
 	}
 	
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/FeedResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/FeedResource.java
index a7b4f73..382d88c 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/FeedResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/FeedResource.java
@@ -56,7 +56,9 @@
 @Produces(MediaType.APPLICATION_JSON)
 @Authorization
 public class FeedResource extends BaseLoggingClass {
-	
+
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
+
 	@GET
 	@ApiOperation( value = "return Feed details", 
 	notes = "Returns array of  `Feed` objects.", 
@@ -68,16 +70,13 @@
 	public Response getFeeds(
 			@QueryParam("feedName") String feedName,
 			@QueryParam("version") String version,
-			@QueryParam("match") String match
-			) {
-
-		ApiService resp = new ApiService();
+			@QueryParam("match") String match) {
 
 		FeedService feedService = new FeedService();
 		List<Feed> nfeeds =  feedService.getAllFeeds( feedName, version, match );
 		GenericEntity<List<Feed>> list = new GenericEntity<List<Feed>>(nfeeds) {
         };
-        return resp.success(list);
+        return responseBuilder.success(list);
 	}
 	
 
@@ -92,8 +91,7 @@
 	})
 	public Response addFeed( 
 			@WebParam(name = "feed") Feed feed,
-			@QueryParam("useExisting") String useExisting
-			) {
+			@QueryParam("useExisting") String useExisting) {
 
 		ApiService resp = new ApiService();
 
@@ -104,7 +102,7 @@
 			resp.required( "asprClassification", feed.getAsprClassification(), "" );
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		
 		
@@ -113,28 +111,28 @@
 		if ( nfeed == null ) {
 			nfeed =  feedService.addFeed( feed, resp.getErr() );
 			if ( nfeed != null ) {
-				return resp.success(nfeed);
+				return responseBuilder.success(nfeed);
 			} else {
 				logger.error( "Unable to create: " + feed.getFeedName() + ":" + feed.getFeedVersion());
 
-				return resp.error();			
+				return responseBuilder.error(resp.getErr());
 			}
 		} else if ( nfeed.getStatus() == DmaapObject_Status.DELETED ) {
 			feed.setFeedId( nfeed.getFeedId());
 			nfeed =  feedService.updateFeed(feed, resp.getErr());
 			if ( nfeed != null ) {
-				return resp.success(nfeed);
+				return responseBuilder.success(nfeed);
 			} else {
 				logger.info( "Unable to update: " + feed.getFeedName() + ":" + feed.getFeedVersion());
 
-				return resp.error();	
+				return responseBuilder.error(resp.getErr());
 			}
 		} else if ( (useExisting != null) && ("true".compareToIgnoreCase( useExisting ) == 0)) {
-			return resp.success(nfeed);
+			return responseBuilder.success(nfeed);
 		}
 
 		resp.setCode(Status.CONFLICT.getStatusCode());
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 	
 	@PUT
@@ -148,8 +146,7 @@
 	@Path("/{id}")
 	public Response updateFeed( 
 			@PathParam("id") String id,
-			@WebParam(name = "feed") Feed feed 
-			) {
+			@WebParam(name = "feed") Feed feed) {
 
 		FeedService feedService = new FeedService();
 		ApiService resp = new ApiService();
@@ -158,12 +155,12 @@
 			resp.required( "feedId", id, "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 
 		Feed nfeed = feedService.getFeed( id, resp.getErr() );
 		if ( nfeed == null || nfeed.getStatus() == DmaapObject_Status.DELETED ) {
-			return resp.notFound();						
+			return responseBuilder.notFound();
 		}
 	
 		//  we assume there is no updates allowed for pubs and subs objects via this api...		
@@ -174,11 +171,11 @@
 		
 		nfeed =  feedService.updateFeed(nfeed, resp.getErr());
 		if ( nfeed != null ) {
-			return resp.success(nfeed);
+			return responseBuilder.success(nfeed);
 		} else {
 			logger.info( "Unable to update: " + feed.getFeedName() + ":" + feed.getFeedVersion());
 
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 	}
 	
@@ -201,15 +198,15 @@
 		Feed nfeed =  feedService.getFeed( id, resp.getErr() );
 		if ( nfeed == null ) {
 			resp.setCode(Status.NOT_FOUND.getStatusCode());
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		nfeed = feedService.removeFeed( nfeed, resp.getErr() );
 		if ( nfeed == null || nfeed.getStatus() == DmaapObject_Status.DELETED ) {
-			return resp.success(Status.NO_CONTENT.getStatusCode(), null);
+			return responseBuilder.success(Status.NO_CONTENT.getStatusCode(), null);
 		}
 		logger.info( "Unable to delete: " + id + ":" + nfeed.getFeedVersion());
 
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 
 	@GET
@@ -230,8 +227,8 @@
 		Feed nfeed =  feedService.getFeed( id, resp.getErr() );
 		if ( nfeed == null ) {
 			resp.setCode(Status.NOT_FOUND.getStatusCode());
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
-		return resp.success(nfeed);
+		return responseBuilder.success(nfeed);
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/InfoResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/InfoResource.java
index 31c22ba..bcb7ed2 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/InfoResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/InfoResource.java
@@ -32,8 +32,6 @@
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
@@ -44,8 +42,6 @@
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.Dmaap;
-import org.onap.dmaap.dbcapi.service.ApiService;
-import org.onap.dmaap.dbcapi.service.DmaapService;
 
 
 
@@ -57,7 +53,7 @@
 public class InfoResource extends BaseLoggingClass {
 
 
-	DmaapService dmaapService = new DmaapService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	@GET
 	@ApiOperation( value = "return info details", notes = "returns the `info` object", response = Dmaap.class)
@@ -67,9 +63,7 @@
     })
 
 	public Response getInfo(@Context UriInfo uriInfo)  {
-		ApiService check = new ApiService();
-			
-			return check.success(204, null);
+		return responseBuilder.success(204, null);
 	}
 	
 
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClientResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClientResource.java
index a621338..a67ac8f 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClientResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClientResource.java
@@ -50,6 +50,8 @@
 import org.onap.dmaap.dbcapi.service.MR_ClusterService;
 import org.onap.dmaap.dbcapi.service.TopicService;
 
+import static javax.ws.rs.core.Response.Status.NO_CONTENT;
+
 
 @Path("/mr_clients")
 @Api( value= "MR_Clients", description = "Endpoint for a Message Router Client that implements a Publisher or a Subscriber" )
@@ -59,6 +61,7 @@
 public class MR_ClientResource extends BaseLoggingClass {
 
 	private MR_ClientService mr_clientService = new MR_ClientService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 		
 	@GET
 	@ApiOperation( value = "return MR_Client details", 
@@ -69,13 +72,11 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response getMr_Clients() {
-		ApiService resp = new ApiService();
-
 		List<MR_Client> clients = mr_clientService.getAllMr_Clients();
 
 		GenericEntity<List<MR_Client>> list = new GenericEntity<List<MR_Client>>(clients) {
         };
-        return resp.success(list);		
+        return responseBuilder.success(list);
 	}
 		
 	@POST
@@ -90,8 +91,7 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response addMr_Client( 
-			MR_Client client
-			) {
+			MR_Client client) {
 		ApiService resp = new ApiService();
 
 		try {
@@ -106,7 +106,7 @@
 
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		MR_ClusterService clusters = new MR_ClusterService();
 
@@ -117,7 +117,7 @@
 			resp.setMessage( "MR_Cluster alias not found for dcaeLocation: " + client.getDcaeLocationName());
 			resp.setFields("dcaeLocationName");
 			logger.warn( resp.toString() );
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		String url = cluster.getFqdn();
 		if ( url == null || url.isEmpty() ) {
@@ -126,22 +126,22 @@
 			resp.setMessage("FQDN not set for dcaeLocation " + client.getDcaeLocationName() );
 			resp.setFields("fqdn");
 			logger.warn( resp.toString() );
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		TopicService topics = new TopicService();
 
 		Topic t = topics.getTopic(client.getFqtn(), resp.getErr() );
 		if ( t == null ) {
-			return resp.error();		
+			return responseBuilder.error(resp.getErr());
 		}
 		MR_Client nClient =  mr_clientService.addMr_Client(client, t, resp.getErr());
 		if ( resp.getErr().is2xx()) {
 			t = topics.getTopic(client.getFqtn(),  resp.getErr());
 			topics.checkForBridge(t, resp.getErr());
-			return resp.success(nClient);
+			return responseBuilder.success(nClient);
 		}
 		else {
-			return resp.error();			
+			return responseBuilder.error(resp.getErr());
 		}
 	}
 		
@@ -168,7 +168,7 @@
 
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();		
+			return responseBuilder.error(resp.getErr());
 		}
 		client.setMrClientId(clientId);
 		MR_Client nClient = mr_clientService.updateMr_Client(client, resp.getErr() );
@@ -199,14 +199,14 @@
 			resp.required( "clientId", id, "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		mr_clientService.removeMr_Client(id, true, resp.getErr() );
 		if ( resp.getErr().is2xx()) {
-			return resp.success(Status.NO_CONTENT.getStatusCode(), null);
+			return responseBuilder.success(NO_CONTENT.getStatusCode(), null);
 		}
 		
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 
 	@GET
@@ -227,12 +227,12 @@
 			resp.required( "clientId", id, "");
 		} catch ( RequiredFieldException rfe ) {
 			logger.debug( resp.toString() );
-			return resp.error();	
+			return responseBuilder.error(resp.getErr());
 		}
 		MR_Client nClient =  mr_clientService.getMr_Client( id, resp.getErr() );
 		if ( resp.getErr().is2xx()) {
-			return resp.success(nClient);
+			return responseBuilder.success(nClient);
 		}
-		return resp.error();	
+		return responseBuilder.error(resp.getErr());
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClusterResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClusterResource.java
index 50ab4db..5d2d379 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClusterResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/MR_ClusterResource.java
@@ -44,7 +44,6 @@
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.MR_Cluster;
 import org.onap.dmaap.dbcapi.service.ApiService;
-import org.onap.dmaap.dbcapi.service.MR_ClientService;
 import org.onap.dmaap.dbcapi.service.MR_ClusterService;
 
 
@@ -55,8 +54,8 @@
 @Authorization
 public class MR_ClusterResource extends BaseLoggingClass {
 
-	MR_ClusterService mr_clusterService = new MR_ClusterService();
-	MR_ClientService mr_clients = new MR_ClientService();
+	private MR_ClusterService mr_clusterService = new MR_ClusterService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 		
 	@GET
 	@ApiOperation( value = "return MR_Cluster details", 
@@ -67,13 +66,11 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response getMr_Clusters() {
-		ApiService resp = new ApiService();
-
 		List<MR_Cluster> clusters = mr_clusterService.getAllMr_Clusters();
 
 		GenericEntity<List<MR_Cluster>> list = new GenericEntity<List<MR_Cluster>>(clusters) {
         };
-        return resp.success(list);
+        return responseBuilder.success(list);
 	}
 		
 	@POST
@@ -85,21 +82,20 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response  addMr_Cluster( 
-			MR_Cluster cluster
-			) {
+			MR_Cluster cluster) {
 		ApiService resp = new ApiService();
 
 		try {
 			resp.required( "dcaeLocationName", cluster.getDcaeLocationName(), "" );  
 			resp.required( "fqdn", cluster.getFqdn(), "" );
 		} catch( RequiredFieldException rfe ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		MR_Cluster mrc =  mr_clusterService.addMr_Cluster(cluster, resp.getErr() );
 		if ( mrc != null && mrc.isStatusValid() ) {
-			return resp.success(Status.CREATED.getStatusCode(), mrc);
+			return responseBuilder.success(Status.CREATED.getStatusCode(), mrc);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 
 	}
 		
@@ -122,14 +118,14 @@
 			resp.required( "fqdn", clusterId, "" );
 			resp.required( "dcaeLocationName", cluster.getDcaeLocationName(), "" );  
 		} catch( RequiredFieldException rfe ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		cluster.setDcaeLocationName(clusterId);
 		MR_Cluster mrc =  mr_clusterService.updateMr_Cluster(cluster, resp.getErr() );
 		if ( mrc != null && mrc.isStatusValid() ) {
-			return resp.success(Status.CREATED.getStatusCode(), mrc);
+			return responseBuilder.success(Status.CREATED.getStatusCode(), mrc);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 		
 	@DELETE
@@ -149,13 +145,13 @@
 		try {
 			resp.required( "fqdn", id, "" );
 		} catch( RequiredFieldException rfe ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		mr_clusterService.removeMr_Cluster(id, resp.getErr() );
 		if ( resp.getErr().is2xx()) {
-			return resp.success(Status.NO_CONTENT.getStatusCode(), null);
+			return responseBuilder.success(Status.NO_CONTENT.getStatusCode(), null);
 		} 
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 
 	@GET
@@ -175,12 +171,12 @@
 		try {
 			resp.required( "dcaeLocationName", id, "" );
 		} catch( RequiredFieldException rfe ) {
-			return resp.error();
+			return responseBuilder.error(resp.getErr());
 		}
 		MR_Cluster mrc =  mr_clusterService.getMr_Cluster( id, resp.getErr() );
 		if ( mrc != null && mrc.isStatusValid() ) {
-			return resp.success(Status.CREATED.getStatusCode(), mrc);
+			return responseBuilder.success(Status.CREATED.getStatusCode(), mrc);
 		}
-		return resp.error();
+		return responseBuilder.error(resp.getErr());
 	}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/ResponseBuilder.java b/src/main/java/org/onap/dmaap/dbcapi/resources/ResponseBuilder.java
new file mode 100644
index 0000000..5d78aaf
--- /dev/null
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/ResponseBuilder.java
@@ -0,0 +1,85 @@
+/*
+ * ============LICENSE_START=======================================================
+ * PNF-REGISTRATION-HANDLER
+ * ================================================================================
+ * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+
+package org.onap.dmaap.dbcapi.resources;
+
+import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
+import org.onap.dmaap.dbcapi.model.ApiError;
+import org.slf4j.MDC;
+
+import javax.ws.rs.core.Response;
+
+import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_CODE;
+import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_DESC;
+import static com.att.eelf.configuration.Configuration.MDC_STATUS_CODE;
+import static javax.ws.rs.core.Response.Status.NOT_FOUND;
+import static javax.ws.rs.core.Response.Status.SERVICE_UNAVAILABLE;
+import static javax.ws.rs.core.Response.Status.UNAUTHORIZED;
+
+public class ResponseBuilder extends BaseLoggingClass {
+
+    Response success(Object d) {
+        return buildSuccessResponse(d, Response.Status.OK.getStatusCode());
+    }
+
+    Response success(int code, Object d) {
+        return buildSuccessResponse(d, code);
+    }
+
+    Response error(ApiError err) {
+        return buildErrResponse(err);
+    }
+
+    Response unauthorized(String msg) {
+        return buildErrResponse(new ApiError(UNAUTHORIZED.getStatusCode(), msg, "Authorization"));
+    }
+
+    Response unavailable() {
+        return buildErrResponse(new ApiError(SERVICE_UNAVAILABLE.getStatusCode(),
+                "Request is unavailable due to unexpected condition"));
+    }
+
+    Response notFound() {
+        return buildErrResponse(new ApiError(NOT_FOUND.getStatusCode(),"Requested object not found"));
+    }
+
+    private Response buildSuccessResponse(Object d, int code) {
+        MDC.put(MDC_STATUS_CODE, "COMPLETE");
+        MDC.put(MDC_RESPONSE_DESC, "");
+        return buildResponse(d, code);
+    }
+
+    private Response buildErrResponse(ApiError err) {
+        MDC.put(MDC_STATUS_CODE, "ERROR");
+        MDC.put(MDC_RESPONSE_DESC, err.getMessage());
+
+        return buildResponse(err, err.getCode());
+    }
+
+    private Response buildResponse(Object obj, int code) {
+        MDC.put(MDC_RESPONSE_CODE, String.valueOf(code));
+
+        auditLogger.auditEvent("");
+        return Response.status(code)
+                .entity(obj)
+                .build();
+    }
+}
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java b/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java
index be1b3ac..4f442c9 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/resources/TopicResource.java
@@ -50,6 +50,8 @@
 import org.onap.dmaap.dbcapi.service.TopicService;
 import org.onap.dmaap.dbcapi.util.DmaapConfig;
 
+import static javax.ws.rs.core.Response.Status.CREATED;
+
 @Path("/topics")
 @Api( value= "topics", description = "Endpoint for retreiving MR Topics" )
 @Consumes(MediaType.APPLICATION_JSON)
@@ -59,7 +61,8 @@
 	private static FqtnType defaultTopicStyle;
 	private static String defaultPartitionCount;
 	private static String defaultReplicationCount;
-	TopicService mr_topicService = new TopicService();
+	private TopicService mr_topicService = new TopicService();
+	private ResponseBuilder responseBuilder = new ResponseBuilder();
 	
 	public TopicResource() {
 		DmaapConfig p = (DmaapConfig)DmaapConfig.getConfig();
@@ -79,14 +82,11 @@
 	    @ApiResponse( code = 400, message = "Error", response = ApiError.class )
 	})
 	public Response getTopics() {
-
-		ApiService check = new ApiService();
-
 		List<Topic> allTopics = mr_topicService.getAllTopics();
 		
 		GenericEntity<List<Topic>> list = new GenericEntity<List<Topic>>(allTopics) {
 		        };
-		return check.success(list);
+		return responseBuilder.success(list);
 		
 	}
 		
@@ -114,7 +114,7 @@
 			check.required( "owner", topic.getOwner(), "" );
 		} catch( RequiredFieldException rfe ) {
 			logger.error("Error", rfe);
-			return check.error();
+			return responseBuilder.error(check.getErr());
 		}
 		
 		ReplicationType t = topic.getReplicationCase();
@@ -142,9 +142,9 @@
 		
 		Topic mrc =  mr_topicService.addTopic(topic, check.getErr(), flag);
 		if ( mrc != null && check.getErr().is2xx() ) {
-			return check.success(Status.CREATED.getStatusCode(), mrc);
+			return responseBuilder.success(CREATED.getStatusCode(), mrc);
 		}
-		return check.error();
+		return responseBuilder.error(check.getErr());
 	}
 	
 	@PUT
@@ -164,7 +164,7 @@
 		check.setCode(Status.BAD_REQUEST.getStatusCode());
 		check.setMessage( "Method /PUT not supported for /topics");
 		
-		return check.error();
+		return responseBuilder.error(check.getErr());
 	}
 		
 	@DELETE
@@ -185,14 +185,14 @@
 			check.required( "fqtn", id, "" );
 		} catch( RequiredFieldException rfe ) {
 			logger.error("Error", rfe);
-			return check.error();
+			return responseBuilder.error(check.getErr());
 		}
 		
 		mr_topicService.removeTopic(id, check.getErr());
 		if ( check.getErr().is2xx()) {
-			return check.success(Status.NO_CONTENT.getStatusCode(), null);
+			return responseBuilder.success(Status.NO_CONTENT.getStatusCode(), null);
 		} 
-		return check.error();
+		return responseBuilder.error(check.getErr());
 	}
 	
 
@@ -215,12 +215,12 @@
 			check.required( "topicName", id, "^\\S+$" );  //no white space allowed in topicName
 		} catch( RequiredFieldException rfe ) {
 			logger.error("Error", rfe);
-			return check.error();
+			return responseBuilder.error(check.getErr());
 		}
 		Topic mrc =  mr_topicService.getTopic( id, check.getErr() );
 		if ( mrc == null ) {
-			return check.error();
+			return responseBuilder.error(check.getErr());
 		}
-		return check.success(mrc);
+		return responseBuilder.success(mrc);
 		}
 }
diff --git a/src/main/java/org/onap/dmaap/dbcapi/service/ApiService.java b/src/main/java/org/onap/dmaap/dbcapi/service/ApiService.java
index 48f81db..23f4fef 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/service/ApiService.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/service/ApiService.java
@@ -25,10 +25,7 @@
 import static com.att.eelf.configuration.Configuration.MDC_END_TIMESTAMP;
 import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
 import static com.att.eelf.configuration.Configuration.MDC_PARTNER_NAME;
-import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_CODE;
-import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_DESC;
 import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME;
-import static com.att.eelf.configuration.Configuration.MDC_STATUS_CODE;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -36,7 +33,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 import javax.xml.bind.DatatypeConverter;
 
@@ -191,7 +187,7 @@
 
 
 	public void setCode(int statusCode) {
-		err.setCode(statusCode);	
+		err.setCode(statusCode);
 	}
 
 
@@ -203,63 +199,6 @@
 	public void setFields(String string) {
 		err.setFields(string);
 	}
-
-	private Response  buildResponse( Object obj ) {
-		stopwatch.stop();
-		MDC.put( MDC_RESPONSE_CODE, String.valueOf(err.getCode()) );
-		
-		auditLogger.auditEvent( "" );
-		return Response.status( err.getCode())
-				.entity(obj)
-				.build();
-	}
-	private Response  buildSuccessResponse(Object d) {
-		MDC.put( MDC_STATUS_CODE,  "COMPLETE");
-		MDC.put( MDC_RESPONSE_DESC, "");
-		return buildResponse( d );
-	}
-	private Response  buildErrResponse() {
-	
-		MDC.put( MDC_STATUS_CODE,  "ERROR");
-		MDC.put( MDC_RESPONSE_DESC, err.getMessage());
-		
-		return buildResponse(getErr());
-	}
-	public Response success( Object d ) {
-		err.setCode(Status.OK.getStatusCode());
-		return buildSuccessResponse(d);
-				
-	}
-	public Response success( int code, Object d ) {
-		err.setCode(code);
-		return buildSuccessResponse(d);
-	}
-
-	public Response unauthorized( String msg ) {
-		err.setCode(Status.UNAUTHORIZED.getStatusCode());
-		err.setFields( "Authorization");
-		err.setMessage( msg );
-		return buildErrResponse();
-	}
-	public Response unauthorized() {
-		err.setCode(Status.UNAUTHORIZED.getStatusCode());
-		err.setFields( "Authorization");
-		err.setMessage( "User credentials in HTTP Header field Authorization are not authorized for the requested action");
-		return buildErrResponse();
-	}
-	public Response unavailable() {
-		err.setCode(Status.SERVICE_UNAVAILABLE.getStatusCode());
-		err.setMessage( "Request is unavailable due to unexpected condition");
-		return buildErrResponse();
-	}
-	public Response notFound() {
-		err.setCode(Status.NOT_FOUND.getStatusCode());
-		err.setMessage( "Requested object not found");
-		return buildErrResponse();
-	}
-	public Response error() {
-		return buildErrResponse();
-	}
 	
 	public void checkAuthorization( String auth, String uriPath, String httpMethod ) throws AuthenticationErrorException, Exception {
 		authorization = auth;
diff --git a/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java b/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java
index cb81619..c5937f4 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/service/TopicService.java
@@ -42,7 +42,6 @@
 import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum;
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.DcaeLocation;
-import org.onap.dmaap.dbcapi.model.Dmaap;
 import org.onap.dmaap.dbcapi.model.DmaapObject.DmaapObject_Status;
 import org.onap.dmaap.dbcapi.model.MR_Client;
 import org.onap.dmaap.dbcapi.model.MR_Cluster;
diff --git a/src/test/java/org/onap/dmaap/dbcapi/resources/ResponseBuilderTest.java b/src/test/java/org/onap/dmaap/dbcapi/resources/ResponseBuilderTest.java
new file mode 100644
index 0000000..ff61d14
--- /dev/null
+++ b/src/test/java/org/onap/dmaap/dbcapi/resources/ResponseBuilderTest.java
@@ -0,0 +1,96 @@
+/*
+ * ============LICENSE_START=======================================================
+ * PNF-REGISTRATION-HANDLER
+ * ================================================================================
+ * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.dmaap.dbcapi.resources;
+
+import org.junit.Test;
+import org.onap.dmaap.dbcapi.model.ApiError;
+
+import javax.ws.rs.core.Response;
+
+import static javax.ws.rs.core.Response.Status.NOT_FOUND;
+import static javax.ws.rs.core.Response.Status.SERVICE_UNAVAILABLE;
+import static javax.ws.rs.core.Response.Status.UNAUTHORIZED;
+import static org.junit.Assert.assertEquals;
+
+public class ResponseBuilderTest {
+
+    private static final String OBJECT = "Objcect";
+    private static final String MESSAGE = "msg";
+    private static final int CODE = 100;
+    private ResponseBuilder responseBuilder = new ResponseBuilder();
+
+    @Test
+    public void success_shouldCreateResponseWithOKStatusCode() {
+
+        Response response = responseBuilder.success(OBJECT);
+
+        assertEquals(OBJECT, response.getEntity());
+        assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+    }
+
+    @Test
+    public void success_shouldCreateResponseWithDefinedStatusCode() {
+
+        Response response = responseBuilder.success(CODE, OBJECT);
+
+        assertEquals(OBJECT, response.getEntity());
+        assertEquals(CODE, response.getStatus());
+    }
+
+    @Test
+    public void unauthorized_shouldCreateCorrectResponse() {
+
+        ApiError error = new ApiError(UNAUTHORIZED.getStatusCode(), MESSAGE, "Authorization");
+        Response response = responseBuilder.unauthorized(MESSAGE);
+
+        assertEquals(error, response.getEntity());
+        assertEquals(error.getCode(), response.getStatus());
+    }
+
+    @Test
+    public void unavailable_shouldCreateCorrectResponse() {
+
+        ApiError error = new ApiError(SERVICE_UNAVAILABLE.getStatusCode(),
+                "Request is unavailable due to unexpected condition");
+        Response response = responseBuilder.unavailable();
+
+        assertEquals(error, response.getEntity());
+        assertEquals(error.getCode(), response.getStatus());
+    }
+
+    @Test
+    public void notFound_shouldCreateCorrectResponse() {
+        ApiError error = new ApiError(NOT_FOUND.getStatusCode(), "Requested object not found");
+        Response response = responseBuilder.notFound();
+
+        assertEquals(error, response.getEntity());
+        assertEquals(error.getCode(), response.getStatus());
+    }
+
+    @Test
+    public void error_shouldCreateCorrectResponse() {
+        ApiError error = new ApiError(CODE, "Some Error");
+        Response response = responseBuilder.error(error);
+
+        assertEquals(error, response.getEntity());
+        assertEquals(error.getCode(), response.getStatus());
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/onap/dmaap/dbcapi/service/ApiServiceTest.java b/src/test/java/org/onap/dmaap/dbcapi/service/ApiServiceTest.java
index 67489e1..33cce9d 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/service/ApiServiceTest.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/service/ApiServiceTest.java
@@ -19,19 +19,13 @@
  */
 package org.onap.dmaap.dbcapi.service;
 
-import  org.onap.dmaap.dbcapi.model.*;
-import  org.onap.dmaap.dbcapi.aaf.*;
 import org.onap.dmaap.dbcapi.authentication.AuthenticationErrorException;
 import org.onap.dmaap.dbcapi.resources.*;
 import org.onap.dmaap.dbcapi.testframework.ReflectionHarness;
 
-import static org.junit.Assert.*;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import java.util.List;
-import javax.ws.rs.core.Response;
 
 public class ApiServiceTest {
 
@@ -55,8 +49,8 @@
 	public void test1() {
 
 
-		//rh.reflect( "org.onap.dmaap.dbcapi.service.ApiService", "get", null );	
-	
+		//rh.reflect( "org.onap.dmaap.dbcapi.service.ApiService", "get", null );
+
 	}
 
 	@Test
@@ -74,12 +68,6 @@
 			nd.required( "aName", null, "anExpr" );
 		} catch ( RequiredFieldException rfe ) {
 		}
-		String out = nd.toString();	
-		Response r = nd.unauthorized( "aMessage" );
-		r = nd.unauthorized();
-		r = nd.unavailable();
-		r = nd.notFound();
-		r = nd.error();
 		try {
 			nd.checkAuthorization( "authval", "/uri/Path", "GET" );
 			nd.checkAuthorization();
