diff --git a/lib/xos-api/xosapi/orm.py b/lib/xos-api/xosapi/orm.py
index 08b73e3..fccee09 100644
--- a/lib/xos-api/xosapi/orm.py
+++ b/lib/xos-api/xosapi/orm.py
@@ -883,19 +883,28 @@
 
 
 def import_convenience_methods():
+    # The ORM has several built-in convenience methods that are contained here
+    lib_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
+    base_convenience_dir = os.path.join(lib_dir, "convenience")
 
-    log.info("Loading convenience methods")
+    # Service convenience methods are placed here during dynamicload
+    service_convenience_dir = "/var/run/xosapi/convenience"
 
-    cwd = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-    api_convenience_dir = os.path.join(cwd, "convenience")
-    for file in os.listdir(api_convenience_dir):
-        if file.endswith(".py") and "test" not in file:
-            pathname = os.path.join(api_convenience_dir, file)
-            try:
-                log.debug("Loading: %s" % file)
-                imp.load_source(file[:-3], pathname)
-            except Exception:
-                log.exception(
-                    "Cannot import api convenience method for: %s, %s"
-                    % (file[:-3], pathname)
-                )
+    for api_convenience_dir in [base_convenience_dir, service_convenience_dir]:
+        log.info("Loading convenience methods", api_convenience_dir=api_convenience_dir)
+
+        if not os.path.exists(api_convenience_dir):
+            log.info("No convenience methods found", api_convenience_dir=api_convenience_dir)
+            continue
+
+        for file in os.listdir(api_convenience_dir):
+            if file.endswith(".py") and "test" not in file:
+                pathname = os.path.join(api_convenience_dir, file)
+                try:
+                    log.debug("Loading: %s" % file)
+                    imp.load_source(file[:-3], pathname)
+                except Exception:
+                    log.exception(
+                        "Cannot import api convenience method for: %s, %s"
+                        % (file[:-3], pathname)
+                    )
diff --git a/lib/xos-api/xosapi/xos_grpc_client.py b/lib/xos-api/xosapi/xos_grpc_client.py
index fba9ce4..c376552 100644
--- a/lib/xos-api/xosapi/xos_grpc_client.py
+++ b/lib/xos-api/xosapi/xos_grpc_client.py
@@ -77,18 +77,19 @@
 
         return self
 
-    def load_convenience_methods(self):
+    def request_convenience_methods(self):
 
-        convenience_methods_dir = (
-            "/usr/local/lib/python2.7/dist-packages/xosapi/convenience/"
-        )
+        convenience_methods_dir = "/var/run/xosapi/convenience"
+        if not os.path.exists(convenience_methods_dir):
+            log.info("Creating convenience methods directory", convenience_methods_dir=convenience_methods_dir)
+            os.makedirs(convenience_methods_dir)
 
         try:
             response = self.dynamicload.GetConvenienceMethods(Empty())
 
             if response:
                 log.info(
-                    "Loading convenience methods",
+                    "Saving convenience methods",
                     methods=[m.filename for m in response.convenience_methods],
                 )
 
@@ -135,7 +136,7 @@
             self.xos_orm = orm.ORMStub(self.xos, self.xos_pb2, "xos")
 
         # ask the core for the convenience methods
-        self.load_convenience_methods()
+        self.request_convenience_methods()
 
         # Load convenience methods after reconnect
         orm.import_convenience_methods()
