   (GET "/series-names" []
     (get-series-names))
 
-  (GET "/data/:series-name" [ series-name ]
-    (get-data-for-series-name series-name))
+  (GET "/data/:series-name" {{series-name :series-name
+                              window-secs :window-secs}
+                             :params}
+    (get-data-for-series-name series-name (or (parsable-integer? window-secs) 86400)))
 
   (GET "/latest/:series-name" [ series-name ]
     (get-latest-data-for-series-name series-name))

                                 " FROM sample, series"
                                 " WHERE sample.series_id = series.series_id"
                                 "   AND series.series_name=?"
                                 "   AND t > TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_TIMESTAMP)"
                                 " ORDER BY t")
                            series-name])})))

(defn get-series-names [ ]
  (edn-response

                                     series-id series-id])]
      (edn-response val))))

(defn get-data-for-series-name [ series-name window-size-secs ]
  (edn-response
   (merge {}
          {:data
