           for collection in Zotero.getCollections()
             @collection(collection)
 
-          for group in Zotero.Groups.getAll()
-            @group(group)
-
-          # TODO: add saved searches
+          for search in Zotero.Searches.getAll()
+            @search(search)
+
+          @group()
+
           return)
 
         sendResponseCallback(200, "application/atom+xml", feed.serialize())

    collection: "with recursive collectiontree (collection) as (values (?) union all select c.collectionID from collections c join collectiontree ct on c.parentCollectionID = ct.collection) select max(dateModified) from collectiontree ct join collectionItems ci on ct.collection = ci.collectionID join items i on ci.itemID = i.itemID"

  endpoints:
    index:
      supportedMethods: ["GET"]
      init: (url, data, sendResponseCallback) ->

          for item in collection.getChildItems(false) || []
            @item(item)

          return)

        sendResponseCallback(200, "application/atom+xml", feed.serialize())
        return

    search:
      supportedMethods: ["GET"]
      init: (url, data, sendResponseCallback) ->
        Zotero.OPDS.log("Search: #{JSON.stringify(url.query.library)}, #{JSON.stringify(url.query.key)}")
        search = Zotero.Searches.getByLibraryAndKey((if url.query.library == '0' then null else url.query.library), url.query.key)
        Zotero.OPDS.log('Search:', typeof search)

        feed = new Zotero.OPDS.Feed("/opds/search?library=#{url.query.library}&key=#{url.query.key}", "Search: #{search.name}", null, ->
          items = search.search() || []
          if items.length > 0
            for item in Zotero.Items.get(items)
              @item(item)
          return)

        sendResponseCallback(200, "application/atom+xml", feed.serialize())
