 
 ;; TODO: think about lenses
 
+(defn save-apply [& args]
+  (try
+    (apply (first args) (rest args))
+    (catch js/Object _
+      nil)))
+
 (defn get-serial-by-index [content index]
   (-> content
-      (nth (first index))))
+      (save-apply nth (first index))))
 
 (defn get-seasons-by-index [content index]
   (-> (get-serial-by-index content index)

      (load-if-not-exist
       (partial get-chapters-by-index active-content)
       (fn [[_ {path :path}]]
         (rdb/download-json remote-db path)))
      (.catch (fn [err]
                (if (= (.-message err) "Network request failed")
                  (dispatch [:show-network-error])


(defn get-chapter-by-index [content index]
  (-> (get-chapters-by-index content index)
      (save-nth (-> index (rest) (rest) (first)))))

(defn load-if-not-exist
  ([getter load-fn on-loaded]
