diff --git a/src/vcl/vcl_bapi.c b/src/vcl/vcl_bapi.c
index a98b181..194c136 100644
--- a/src/vcl/vcl_bapi.c
+++ b/src/vcl/vcl_bapi.c
@@ -137,7 +137,8 @@
   if (mp->n_fds)
     {
       vec_validate (fds, mp->n_fds);
-      if (vl_socket_client_recv_fd_msg (fds, mp->n_fds, 5))
+      if (vl_socket_client_recv_fd_msg2 (&wrk->bapi_sock_ctx, fds, mp->n_fds,
+					 5))
 	goto failed;
 
       if (mp->fd_flags & SESSION_FD_F_VPP_MQ_SEGMENT)
@@ -217,7 +218,8 @@
   if (mp->n_fds)
     {
       vec_validate (fds, mp->n_fds);
-      if (vl_socket_client_recv_fd_msg (fds, mp->n_fds, 5))
+      if (vl_socket_client_recv_fd_msg2 (&wrk->bapi_sock_ctx, fds, mp->n_fds,
+					 5))
 	goto failed;
 
       if (mp->fd_flags & SESSION_FD_F_VPP_MQ_SEGMENT)
@@ -510,19 +512,25 @@
 vppcom_connect_to_vpp (char *app_name)
 {
   vcl_worker_t *wrk = vcl_worker_get_current ();
-  api_main_t *am = vlibapi_get_main ();
   vppcom_cfg_t *vcl_cfg = &vcm->cfg;
+  api_main_t *am;
+
+  vlibapi_set_main (&wrk->bapi_api_ctx);
+  vlibapi_set_memory_client_main (&wrk->bapi_shm_ctx);
+  vppcom_api_hookup ();
 
   if (vcl_cfg->vpp_api_socket_name)
     {
-      if (vl_socket_client_connect ((char *) vcl_cfg->vpp_api_socket_name,
-				    app_name, 0 /* default rx/tx buffer */ ))
+      if (vl_socket_client_connect2 (&wrk->bapi_sock_ctx,
+				     (char *) vcl_cfg->vpp_api_socket_name,
+				     app_name, 0 /* default rx/tx buffer */ ))
 	{
 	  VERR ("app (%s) socket connect failed!", app_name);
 	  return VPPCOM_ECONNREFUSED;
 	}
 
-      if (vl_socket_client_init_shm (0, 1 /* want_pthread */ ))
+      if (vl_socket_client_init_shm2 (&wrk->bapi_sock_ctx, 0,
+				      1 /* want_pthread */ ))
 	{
 	  VERR ("app (%s) init shm failed!", app_name);
 	  return VPPCOM_ECONNREFUSED;
@@ -533,6 +541,8 @@
       if (!vcl_cfg->vpp_api_filename)
 	vcl_cfg->vpp_api_filename = format (0, "/vpe-api%c", 0);
 
+      vl_set_memory_root_path ((char *) vcl_cfg->vpp_api_chroot);
+
       VDBG (0, "app (%s) connecting to VPP api (%s)...",
 	    app_name, vcl_cfg->vpp_api_filename);
 
@@ -542,9 +552,9 @@
 	  VERR ("app (%s) connect failed!", app_name);
 	  return VPPCOM_ECONNREFUSED;
 	}
-
     }
 
+  am = vlibapi_get_main ();
   wrk->vl_input_queue = am->shmem_hdr->vl_input_queue;
   wrk->my_client_index = (u32) am->my_client_index;
   wrk->wrk_state = STATE_APP_CONN_VPP;
diff --git a/src/vcl/vcl_cfg.c b/src/vcl/vcl_cfg.c
index cce60ba..3be6de0 100644
--- a/src/vcl/vcl_cfg.c
+++ b/src/vcl/vcl_cfg.c
@@ -228,7 +228,7 @@
   int fd;
   unformat_input_t _input, *input = &_input;
   unformat_input_t _line_input, *line_input = &_line_input;
-  u8 vc_cfg_input = 0, *chroot_path;
+  u8 vc_cfg_input = 0;
   struct stat s;
   u32 uid, gid, q_len;
 
@@ -282,19 +282,12 @@
 	      VCFG_DBG (0, "VCL<%d>: configured max-workers %u", getpid (),
 			vcl_cfg->max_workers);
 	    }
-	  else if (unformat (line_input, "api-prefix %s", &chroot_path))
+	  else if (unformat (line_input, "api-prefix %s",
+			     &vcl_cfg->vpp_api_chroot))
 	    {
-	      vec_terminate_c_string (chroot_path);
-	      if (vcl_cfg->vpp_api_filename)
-		vec_free (vcl_cfg->vpp_api_filename);
-	      vcl_cfg->vpp_api_filename = format (0, "/%s-vpe-api%c",
-						  chroot_path, 0);
-	      vl_set_memory_root_path ((char *) chroot_path);
-
-	      VCFG_DBG (0, "VCL<%d>: configured api-prefix (%s) and api "
-			"filename (%s)", getpid (), chroot_path,
-			vcl_cfg->vpp_api_filename);
-	      chroot_path = 0;	/* Don't vec_free() it! */
+	      vec_terminate_c_string (vcl_cfg->vpp_api_chroot);
+	      VCFG_DBG (0, "VCL<%d>: configured api-prefix (%s) ", getpid (),
+			vcl_cfg->vpp_api_chroot);
 	    }
 	  else if (unformat (line_input, "api-socket-name %s",
 			     &vcl_cfg->vpp_api_socket_name))
@@ -563,17 +556,15 @@
   vppcom_cfg_heapsize (conf_fname);
   vppcom_cfg_read_file (conf_fname);
 
+  /* Regrab cfg after heap initialization */
+  vcl_cfg = &vcm->cfg;
   env_var_str = getenv (VPPCOM_ENV_API_PREFIX);
   if (env_var_str)
     {
-      if (vcl_cfg->vpp_api_filename)
-	vec_free (vcl_cfg->vpp_api_filename);
-      vcl_cfg->vpp_api_filename = format (0, "/%s-vpe-api%c", env_var_str, 0);
-      vl_set_memory_root_path ((char *) env_var_str);
-
-      VCFG_DBG (0, "VCL<%d>: configured api prefix (%s) and filename (%s) "
-		"from " VPPCOM_ENV_API_PREFIX "!", getpid (), env_var_str,
-		vcl_cfg->vpp_api_filename);
+      vcl_cfg->vpp_api_chroot = format (0, "%s", env_var_str);
+      vec_terminate_c_string (vcl_cfg->vpp_api_chroot);
+      VCFG_DBG (0, "VCL<%d>: configured api prefix (%s) from "
+		VPPCOM_ENV_API_PREFIX "!", getpid (), env_var_str);
     }
   env_var_str = getenv (VPPCOM_ENV_APP_NAMESPACE_ID);
   if (env_var_str)
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 8fdf755..9116111 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -211,6 +211,7 @@
   char *event_log_path;
   u8 *vpp_api_filename;
   u8 *vpp_api_socket_name;
+  u8 *vpp_api_chroot;
   u32 tls_engine;
 } vppcom_cfg_t;
 
@@ -298,6 +299,9 @@
 
   u32 forked_child;
 
+  socket_client_main_t bapi_sock_ctx;
+  memory_client_main_t bapi_shm_ctx;
+  api_main_t bapi_api_ctx;
 } vcl_worker_t;
 
 typedef struct vppcom_main_t_
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 0bbdea5..ce47766 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1055,7 +1055,6 @@
   vcl_worker_alloc_and_init ();
 
   /* API hookup and connect to VPP */
-  vppcom_api_hookup ();
   vcl_elog_init (vcm);
   vcm->app_state = STATE_APP_START;
   rv = vppcom_connect_to_vpp (app_name);
@@ -3590,11 +3589,21 @@
 int
 vppcom_worker_register (void)
 {
+  vcl_worker_t *wrk;
+  u8 *wrk_name = 0;
+  int rv;
+
   if (!vcl_worker_alloc_and_init ())
     return VPPCOM_EEXIST;
 
-  if (vcl_worker_set_bapi ())
-    return VPPCOM_EEXIST;
+  wrk = vcl_worker_get_current ();
+  wrk_name = format (0, "%s-wrk-%u", vcm->app_name, wrk->wrk_index);
+
+  rv = vppcom_connect_to_vpp ((char *) wrk_name);
+  vec_free (wrk_name);
+
+  if (rv)
+    return VPPCOM_EFAULT;
 
   if (vcl_worker_register_with_vpp ())
     return VPPCOM_EEXIST;
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c
index 5483110..b7d4f2d 100644
--- a/src/vlibmemory/socket_client.c
+++ b/src/vlibmemory/socket_client.c
@@ -260,10 +260,10 @@
   vl_socket_client_enable_disable2 (socket_client_ctx, enable);
 }
 
-clib_error_t *
-vl_sock_api_recv_fd_msg (int socket_fd, int fds[], int n_fds, u32 wait)
+static clib_error_t *
+vl_sock_api_recv_fd_msg_internal (socket_client_main_t * scm, int fds[],
+				  int n_fds, u32 wait)
 {
-  socket_client_main_t *scm = socket_client_ctx;
   char msgbuf[16];
   char ctl[CMSG_SPACE (sizeof (int) * n_fds)
 	   + CMSG_SPACE (sizeof (struct ucred))];
@@ -275,8 +275,11 @@
   pid_t pid __attribute__ ((unused));
   uid_t uid __attribute__ ((unused));
   gid_t gid __attribute__ ((unused));
+  int socket_fd;
   f64 timeout;
 
+  socket_fd = scm->client_socket.fd;
+
   iov[0].iov_base = msgbuf;
   iov[0].iov_len = 5;
   mh.msg_iov = iov;
@@ -324,6 +327,26 @@
   return 0;
 }
 
+clib_error_t *
+vl_sock_api_recv_fd_msg (int socket_fd, int fds[], int n_fds, u32 wait)
+{
+  return vl_sock_api_recv_fd_msg_internal (socket_client_ctx, fds, n_fds,
+					   wait);
+}
+
+clib_error_t *
+vl_sock_api_recv_fd_msg2 (socket_client_main_t * scm, int socket_fd,
+			  int fds[], int n_fds, u32 wait)
+{
+  socket_client_main_t *old_ctx;
+  clib_error_t *error;
+
+  old_ctx = vl_socket_client_ctx_push (scm);
+  error = vl_sock_api_recv_fd_msg_internal (scm, fds, n_fds, wait);
+  vl_socket_client_ctx_pop (old_ctx);
+  return error;
+}
+
 static void vl_api_sock_init_shm_reply_t_handler
   (vl_api_sock_init_shm_reply_t * mp)
 {
@@ -562,7 +585,7 @@
 {
   if (!scm->socket_fd)
     return clib_error_return (0, "no socket");
-  return vl_sock_api_recv_fd_msg (scm->client_socket.fd, fds, n_fds, wait);
+  return vl_sock_api_recv_fd_msg_internal (scm, fds, n_fds, wait);
 }
 
 clib_error_t *
