 (defun get-or-create-story-id (project name)
   (let (story-id)
     (setq story-id (-first-item
-                    (extract-ids-from-stories
-                     (get-stories-by-name
-                      project
-                      name))))
+                    (--map (assoc-default 'id it)
+                           (get-stories-by-name project name))))
     (if (not story-id)
-        (setq
-         story-id
-         (assoc-default 'id (create-story project name))))
+        (setq story-id (assoc-default 'id (create-story project name))))
     (number-to-string story-id)))
 
 (defun add-data-to-test-buffer (data)

                          (assoc-default 'general_problem jdata))))))
    pivotal-api-result))

(defun get-project-id (project)
  (call-pivotal-api
   "GET"
   "projects"
   (lambda (data)
     (extract-project-id-from-data project data))))

(defun extract-stories (data)
  (coerce
   (assoc-default 'stories
                  (assoc-default 'stories
                                 (json-read-from-string data)))
   'list))

(defun extract-names-from-stories (stories)
  (--map (assoc-default 'name it)
         stories))

(defun extract-ids-from-stories (stories)
  (--map (assoc-default 'id it)
         stories))

(defun search-for-stories (project search-query)
  (let (stories

  (erase-buffer)
  (insert (format "%s" data))
  (pop-to-buffer (current-buffer))))

(defun update-pivotal-story (project name params)
  (let ((story-id (get-or-create-story-id project name)))
