           route-params :route-params} :request} ctx
         userless-items (->> items
                             (map #(dissoc % :user_id)))
-        exploded-items (->> items
-                            (map #(dissoc % :user_id))
-                            (map #(explode-items %)))
+        exploded-items (->> userless-items
+                            (map #(explode-and-sort-by-schema % profile-schema)))
         formatted-items (if (= "text/csv" mime)
                           ; serving tall csv style profiles
-                          (apply util/map-longest add-profile-keys ["" ""] exploded-items)
+                            (apply util/map-longest add-profile-keys ["" ""] exploded-items)
                           ; serving json profiles
                           userless-items)
         ]
-
         (util/render-items ctx formatted-items)))
 
 (defn index-handle-created [handlers ctx]

       (into {})))

(defn attribute-type [attr]
  (if (coll? attr)
       :associated-items
       (try
         (if (map? (json/decode attr))
           :nested-item
           :attribute)
          (catch Exception e
                 :attribute))))

(defn explode-nested-item [item-name item-string]
  (let [item (json/decode item-string)]
    (->> item
         (map
           (fn [pair]
             { (str item-name "_" (key pair)) (val pair) }))
         (into {}))))

(defn explode-associated-items [association-name items]
  (->> items
       (map-indexed
         (fn [index item]
           (let [item-name (str association-name "_" index)]
             (case (attribute-type item)
               :nested-item (explode-nested-item (str association-name "_" index) item)
               :attribute   { item-name item }))))
       (into {})))

(defn explode-items [profile]
  (->> profile
       (map
         (fn [attribute]
           (let [attr-name   (name (key attribute))
                 attr-value  (val attribute)
                 _ (println "Considering\n\tKey: " attr-name "\n\tVal: " attr-value)]
             (case (attribute-type attr-value)
               :associated-items (do
                                   (println "Found associated-items for " attr-name)
                                   (explode-associated-items attr-name attr-value))
               :nested-item      (do
                                   (println "Found nested-item for " attr-name)
                                   (explode-nested-item attr-name attr-value))
               :attribute        (do
                                   (println "Found standard attribute " attr-name)
                                   { attr-name attr-value})))))

       (into {})))

(defn index-handle-ok [ctx]
  (let [{items ::items

   [kixi.hecuba.webutil :as util]
   [kixi.hecuba.webutil :refer (decode-body authorized? stringify-values update-stringified-lists sha1-regex)]
   [liberator.core :refer (defresource)]
   [liberator.representation :refer (ring-response)]
   [schema.core :as s]))

(defn index-exists? [querier ctx]
  (let [request       (:request ctx)
