             (let [results
                   (db/exec-raw [(str "SELECT source.surface AS source, source.id AS source_id,
                                              target.surface AS target,target.root AS target_root,
-                                             source.structure AS structure
+                                             source.structure AS structure,
+                                             target.structure::text AS target_structure
                                         FROM (SELECT surface, source.structure->'synsem'->'sem' 
                                                      AS sem,
                                                      source.structure AS structure, source.id

              (write-str {:source (get-in gcacs [:source])
                          :target_spec target_spec
                          ;; TODO: eventually add :source-v2
                          :gcacs gcacs
                          :targets (get-in gcacs [:targets])
                          :targets-v2
                          (map (fn [surface]
                                 {:surface surface
                                  :roots ["foo","bar"]})
                               (get-in gcacs [:targets]))}))})
      (GET "/:expr" request
           (let [expr (:expr (:route-params request))]
             (log/debug (str "expr(1):" expr))

                           (get-in (strip-refs (deserialize
                                                (read-string (:target target-expression))))
                                              [:synsem :sem])))))
            (let [debug (log/trace (str "source-structure:"
                                        (first (map :structure results))))
                  debug (log/debug (str "read from target_structure:"
                                        (first (map :target_structure results))))
                  debug (log/debug (str "hello:" 
                                        (read-str (first (map :target_structure results)))))
                  debug (log/debug (str "hello2:" 
                                        (json-read-str (first (map :target_structure results)))))]
              {:source-id (first (map :source_id results))
               :source (first (map :source results))
               :targets-v2 (map (fn [result]
                                 {:surface (get result :target)
                                  :root (:target_root result)
                                  :lexemes
                                  (let [structure (json-read-str (:target_structure result))]
                                    (remove nil?
                                            [(get-in structure [:comp :italiano :italiano])
                                             (get-in structure [:root :italiano :infinitive])
                                             (get-in structure [:root :italiano :infinitive])
                                             (get-in structure [:root :italiano :italiano])]))})
                               results)
               :targets (map :target results)})))))))))

(defn get-lexeme [canonical language & [ spec ]]
