diff --git a/libi2pd/Destination.cpp b/libi2pd/Destination.cpp
index d3632881..89b0047e 100644
--- a/libi2pd/Destination.cpp
+++ b/libi2pd/Destination.cpp
@@ -13,10 +13,10 @@ namespace i2p
 {
 namespace client
 {
-	LeaseSetDestination::LeaseSetDestination (bool isPublic, const std::map<std::string, std::string> * params):
-		m_IsRunning (false), m_Thread (nullptr), m_IsPublic (isPublic),
-		m_PublishReplyToken (0), m_LastSubmissionTime (0), m_PublishConfirmationTimer (m_Service),
-		m_PublishVerificationTimer (m_Service), m_PublishDelayTimer (m_Service), m_CleanupTimer (m_Service)
+  LeaseSetDestination::LeaseSetDestination (bool isPublic, const std::map<std::string, std::string> * params, boost::shared_ptr<boost::asio::io_service> service):
+    m_Service(service), m_IsRunning (false), m_Thread (nullptr), m_IsPublic (isPublic),
+    m_PublishReplyToken (0), m_LastSubmissionTime (0), m_PublishConfirmationTimer (*m_Service.get()),
+    m_PublishVerificationTimer (*m_Service.get()), m_PublishDelayTimer (*m_Service.get()), m_CleanupTimer (*m_Service.get())
 	{
 		int inLen   = DEFAULT_INBOUND_TUNNEL_LENGTH;
 		int inQty   = DEFAULT_INBOUND_TUNNELS_QUANTITY;
@@ -102,7 +102,7 @@ namespace client
 			i2p::tunnel::tunnels.DeleteTunnelPool (m_Pool);
 		for (auto& it: m_LeaseSetRequests)
 			it.second->Complete (nullptr);
-	}
+  }
 
 	void LeaseSetDestination::Run ()
 	{
@@ -110,7 +110,7 @@ namespace client
 		{
 			try
 			{
-				m_Service.run ();
+        m_Service->run ();
 			}
 			catch (std::exception& ex)
 			{
@@ -154,7 +154,7 @@ namespace client
 				m_Pool->SetLocalDestination (nullptr);
 				i2p::tunnel::tunnels.StopTunnelPool (m_Pool);
 			}
-			m_Service.stop ();
+      m_Service->stop ();
 			if (m_Thread)
 			{
 				m_Thread->join ();
@@ -282,7 +282,7 @@ namespace client
 		if (m_IsPublic)
 		{
 			auto s = shared_from_this ();
-			m_Service.post ([s](void)
+      m_Service->post ([s](void)
 			{
 				s->m_PublishVerificationTimer.cancel ();
 				s->Publish ();
@@ -306,7 +306,7 @@ namespace client
 		memcpy (data.k, key, 32);
 		memcpy (data.t, tag, 32);
 		auto s = shared_from_this ();
-		m_Service.post ([s,data](void)
+    m_Service->post ([s,data](void)
 			{
 				s->AddSessionKey (data.k, data.t);
 			});
@@ -315,12 +315,12 @@ namespace client
 
 	void LeaseSetDestination::ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg)
 	{
-		m_Service.post (std::bind (&LeaseSetDestination::HandleGarlicMessage, shared_from_this (), msg));
+    m_Service->post (std::bind (&LeaseSetDestination::HandleGarlicMessage, shared_from_this (), msg));
 	}
 
 	void LeaseSetDestination::ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg)
 	{
-		m_Service.post (std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msg));
+    m_Service->post (std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msg));
 	}
 
 	void LeaseSetDestination::HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr<i2p::tunnel::InboundTunnel> from)
@@ -594,17 +594,17 @@ namespace client
 		if (!m_Pool || !IsReady ())
 		{
 			if (requestComplete)
-				m_Service.post ([requestComplete](void){requestComplete (nullptr);});
+        m_Service->post ([requestComplete](void){requestComplete (nullptr);});
 			return false;
 		}
-		m_Service.post (std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), dest, requestComplete));
+    m_Service->post (std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), dest, requestComplete));
 		return true;
 	}
 
 	void LeaseSetDestination::CancelDestinationRequest (const i2p::data::IdentHash& dest, bool notify)
 	{
 		auto s = shared_from_this ();
-		m_Service.post ([dest, notify, s](void)
+    m_Service->post ([dest, notify, s](void)
 			{
 				auto it = s->m_LeaseSetRequests.find (dest);
 				if (it != s->m_LeaseSetRequests.end ())
@@ -622,7 +622,7 @@ namespace client
 		auto floodfill = i2p::data::netdb.GetClosestFloodfill (dest, excluded);
 		if (floodfill)
 		{
-			auto request = std::make_shared<LeaseSetRequest> (m_Service);
+      auto request = std::make_shared<LeaseSetRequest> ((boost::asio::io_service&)*m_Service.get());
 			if (requestComplete)
 				request->requestComplete.push_back (requestComplete);
 			auto ts = i2p::util::GetSecondsSinceEpoch ();
@@ -762,30 +762,30 @@ namespace client
 			else
 				++it;
 		}
-	}
+  }
 
-	ClientDestination::ClientDestination (const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params):
-		LeaseSetDestination (isPublic, params), m_Keys (keys), m_StreamingAckDelay (DEFAULT_INITIAL_ACK_DELAY),
-		m_DatagramDestination (nullptr), m_RefCounter (0),
-		m_ReadyChecker(GetService())
-	{
-		if (isPublic)
-			PersistTemporaryKeys ();
-		else
-			i2p::data::PrivateKeys::GenerateCryptoKeyPair(GetIdentity ()->GetCryptoKeyType (),
-				m_EncryptionPrivateKey, m_EncryptionPublicKey);
-		m_Decryptor = m_Keys.CreateDecryptor (m_EncryptionPrivateKey);
-		if (isPublic)
-			LogPrint (eLogInfo, "Destination: Local address ", GetIdentHash().ToBase32 (), " created");
+  ClientDestination::ClientDestination (const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params, boost::shared_ptr<boost::asio::io_service> service):
+    LeaseSetDestination (isPublic, params, service), m_Keys (keys), m_StreamingAckDelay (DEFAULT_INITIAL_ACK_DELAY),
+    m_DatagramDestination (nullptr), m_RefCounter (0),
+    m_ReadyChecker(GetService())
+  {
+    if (isPublic)
+      PersistTemporaryKeys ();
+    else
+      i2p::data::PrivateKeys::GenerateCryptoKeyPair(GetIdentity ()->GetCryptoKeyType (),
+        m_EncryptionPrivateKey, m_EncryptionPublicKey);
+    m_Decryptor = m_Keys.CreateDecryptor (m_EncryptionPrivateKey);
+    if (isPublic)
+      LogPrint (eLogInfo, "Destination: Local address ", GetIdentHash().ToBase32 (), " created");
 
-		// extract streaming params
-		if (params)
-		{
-			auto it = params->find (I2CP_PARAM_STREAMING_INITIAL_ACK_DELAY);
-			if (it != params->end ())
-				m_StreamingAckDelay = std::stoi(it->second);
-		}
-	}
+    // extract streaming params
+    if (params)
+    {
+      auto it = params->find (I2CP_PARAM_STREAMING_INITIAL_ACK_DELAY);
+      if (it != params->end ())
+        m_StreamingAckDelay = std::stoi(it->second);
+    }
+  }
 
 	ClientDestination::~ClientDestination ()
 	{
diff --git a/libi2pd/Destination.h b/libi2pd/Destination.h
index 3f261bc9..d52c08f7 100644
--- a/libi2pd/Destination.h
+++ b/libi2pd/Destination.h
@@ -90,8 +90,8 @@ namespace client
 
 		public:
 
-			LeaseSetDestination (bool isPublic, const std::map<std::string, std::string> * params = nullptr);
-			~LeaseSetDestination ();
+      LeaseSetDestination (bool isPublic, const std::map<std::string, std::string> * params = nullptr, boost::shared_ptr<boost::asio::io_service> service = boost::shared_ptr<boost::asio::io_service>());
+      ~LeaseSetDestination ();
 			const std::string& GetNickname () const { return m_Nickname; };
 
 			virtual bool Start ();
@@ -101,7 +101,7 @@ namespace client
 			virtual bool Reconfigure(std::map<std::string, std::string> i2cpOpts);
 		
 			bool IsRunning () const { return m_IsRunning; };
-			boost::asio::io_service& GetService () { return m_Service; };
+      boost::asio::io_service& GetService () { return (boost::asio::io_service&)*m_Service.get(); };
 			std::shared_ptr<i2p::tunnel::TunnelPool> GetTunnelPool () { return m_Pool; };
 			bool IsReady () const { return m_LeaseSet && !m_LeaseSet->IsExpired () && m_Pool->GetOutboundTunnels ().size () > 0; };
 			std::shared_ptr<const i2p::data::LeaseSet> FindLeaseSet (const i2p::data::IdentHash& ident);
@@ -149,7 +149,7 @@ namespace client
 
 			volatile bool m_IsRunning;
 			std::thread * m_Thread;
-			boost::asio::io_service m_Service;
+      boost::shared_ptr<boost::asio::io_service> m_Service;
 			mutable std::mutex m_RemoteLeaseSetsMutex;
 			std::map<i2p::data::IdentHash, std::shared_ptr<i2p::data::LeaseSet> > m_RemoteLeaseSets;
 			std::map<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> > m_LeaseSetRequests;
@@ -184,7 +184,7 @@ namespace client
 			void Ready(ReadyPromise & p);
 #endif
 
-			ClientDestination (const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params = nullptr);
+      ClientDestination (const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params = nullptr, boost::shared_ptr<boost::asio::io_service> service = boost::shared_ptr<boost::asio::io_service>());
 			~ClientDestination ();
 
 			virtual bool Start ();
diff --git a/libi2pd/api.cpp b/libi2pd/api.cpp
index 415118ff..cd022061 100644
--- a/libi2pd/api.cpp
+++ b/libi2pd/api.cpp
@@ -83,7 +83,15 @@ namespace api
 		auto localDestination = std::make_shared<i2p::client::ClientDestination> (keys, isPublic, params);
 		localDestination->Start ();
 		return localDestination;
-	}
+  }
+
+  std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (const i2p::data::PrivateKeys& keys, boost::shared_ptr<boost::asio::io_service> service,
+    bool isPublic, const std::map<std::string, std::string> * params)
+  {
+    auto localDestination = std::make_shared<i2p::client::ClientDestination> (keys, isPublic, params, service);
+    //localDestination->Start ();
+    return localDestination;
+  }
 
 	std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (bool isPublic, i2p::data::SigningKeyType sigType,
 		const std::map<std::string, std::string> * params)
diff --git a/libi2pd/api.h b/libi2pd/api.h
index f64590d1..1f51c4a3 100644
--- a/libi2pd/api.h
+++ b/libi2pd/api.h
@@ -3,6 +3,8 @@
 
 #include <memory>
 #include <iostream>
+#include <boost/asio.hpp>
+#include <boost/shared_ptr.hpp>
 #include "Identity.h"
 #include "Destination.h"
 #include "Streaming.h"
@@ -21,7 +23,10 @@ namespace api
 
 	// destinations
 	std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true,
-		const std::map<std::string, std::string> * params = nullptr);
+    const std::map<std::string, std::string> * params = nullptr);
+  std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (const i2p::data::PrivateKeys& keys, boost::shared_ptr<boost::asio::io_service> service,
+    bool isPublic = true, const std::map<std::string, std::string> * params = nullptr);
+
 	std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256,
 		const std::map<std::string, std::string> * params = nullptr); // transient destinations usually not published
 	void DestroyLocalDestination (std::shared_ptr<i2p::client::ClientDestination> dest);