                    (recur (dec tries) "Region not yet moved")
                    (util/info "Region is moved")))))))
        (update-regions!)
-       (response {})))
+       (json-response {})))
 
 (defn wrap-exception [handler]
   (fn [request]

       (util/debug (format "server_regions.json [%s]" remote))
       (let [tables (get params "tables[]" [])
             tables (if (instance? String tables) [tables] tables)]
         (response
           (regions-by-servers (merge (select-keys   @cached  [:regions :servers])
                                      {:metric       (keyword metric)
                                       :sort         (keyword sort)

        servers (into {} (for [[k v] servers]
                           [k (assoc v :html (build-server-popover v))]))]
    (reset! cached {:updated-at now
                    :regions    new-regions
                    :servers    servers
                    :tables     (group-by-tables new-regions)
                    :response   {}})))

(defn start-periodic-updater!
  "Starts a thread that periodically runs update-regions!"
