 
 (defn- ->service-mode
   [service-spec]
-  (str/lower-case (name (first (keys (:Mode service-spec))))))
+  (when service-spec
+    (str/lower-case (name (first (keys (:Mode service-spec)))))))
 
 (defn ->task-node
   [node-id nodes]

(defn ->task-service
  [service-id services]
  (first (filter #(= (:ID %) service-id) services)))

(defn ->task
  [task nodes services]

      :state (get-in task [:Status :State])
      :status {:error (get-in task [:Status :Err])}
      :desiredState (:DesiredState task)
      :serviceName (or service-name service-id)
      :nodeName (or node-name node-id))))

(defn ->tasks
