Index: trunk/lib/Bookmarks/Controller.pm
===================================================================
--- trunk/lib/Bookmarks/Controller.pm	(revision 111)
+++ trunk/lib/Bookmarks/Controller.pm	(revision 112)
@@ -71,4 +71,22 @@
 }
 
+sub _get_search_from_request {
+    my $self = shift;
+
+    my @tags   = grep { $_ ne '' } $self->request->param('tag');
+    my $query  = $self->request->param('q');
+    my $limit  = $self->request->param('limit');
+    my $offset = $self->request->param('offset');
+    my $page   = $self->request->param('page');
+
+    return $self->bookmarks->search({
+        query  => $query,
+        tags   => \@tags,
+        limit  => $limit,
+        offset => $offset,
+        page   => $page,
+    });
+}
+
 sub list {
     my $self = shift;
@@ -79,19 +97,7 @@
     my $format = $self->request->param('format') || 'html';
 
-    my @tags = grep { $_ ne '' } $self->request->param('tag');
-    my $query = $self->request->param('q');
-    my $limit = $self->request->param('limit');
-    my $offset = $self->request->param('offset');
-    my $page = $self->request->param('page');
-
     my $list = Bookmarks::List->new({
         bookmarks => $self->bookmarks,
-        search    => $self->bookmarks->search({
-            query  => $query,
-            tags   => \@tags,
-            limit  => $limit,
-            offset => $offset,
-            page   => $page,
-        }),
+        search    => $self->_get_search_from_request,
     });
 
@@ -101,4 +107,38 @@
     }
     return $list->$as_format;
+}
+
+sub sidebar {
+    my $self = shift;
+
+    my $list = Bookmarks::List->new({
+        bookmarks => $self->bookmarks,
+        search    => $self->_get_search_from_request,
+    });
+
+    require Template;
+    require File::Basename;
+    my $template = Template->new({ INCLUDE_PATH => File::Basename::dirname($INC{'Bookmarks/List.pm'}) });
+
+    my @all_tags = $list->bookmarks->get_tags({ selected => @{ $list->tags }[0] });
+    my @cotags = $list->bookmarks->get_cotags({ search => $list->search });
+
+    $template->process(
+        'list.tt',
+        {
+            base_url     => $list->bookmarks->base_uri,
+            title        => $list->title,
+            query        => $list->query,
+            selected_tag => @{ $list->tags }[0],
+            search_tags  => $list->tags,
+            links        => [ $list->_get_list_links('text/html', { q => $list->query, tag => $list->tags }) ],
+            all_tags     => \@all_tags,
+            cotags       => \@cotags,
+            resources    => $list->results,
+            pages        => $list->search->pages,
+        },
+        \my $output,
+    );
+    return [200, ['Content-Type' => 'text/html; charset=UTF-8'], [$output]];
 }
 
Index: trunk/lib/Bookmarks/List.pm
===================================================================
--- trunk/lib/Bookmarks/List.pm	(revision 111)
+++ trunk/lib/Bookmarks/List.pm	(revision 112)
@@ -32,4 +32,5 @@
             text => 'JSON',
             type => 'application/json',
+            path => 'list',
             query => {
                 %$query,
@@ -40,4 +41,5 @@
             text => 'XBEL',
             type => 'application/xml',
+            path => 'list',
             query => {
                 %$query,
@@ -56,4 +58,5 @@
             text => 'CSV',
             type => 'text/csv',
+            path => 'list',
             query => {
                 %$query,
@@ -64,4 +67,5 @@
             text => 'URI List',
             type => 'text/uri-list',
+            path => 'list',
             query => {
                 %$query,
@@ -72,4 +76,5 @@
             text => 'HTML',
             type => 'text/html',
+            path => 'list',
             query => {
                 %$query,
@@ -105,6 +110,7 @@
 sub as_xbel {
     my $self = shift;
-    require XML::XBEL;
-    #TODO: conditional support; if XML::XBEL is not present, return a 5xx response
+
+    eval { require XML::XBEL; } or
+        return [406, ['Content-Type' => 'text/plain'], ['This server does not support XBEL lists']];
 
     my $xbel = XML::XBEL->new;
@@ -147,5 +153,8 @@
 sub as_csv {
     my $self = shift;
-    require Text::CSV::Encoded;
+
+    eval { require Text::CSV::Encoded } or
+        return [406, ['Content-Type' => 'text/plain'], ['This server does not support CSV lists']];
+
     my $csv = Text::CSV::Encoded->new({ encoding_out => 'utf8' });
     my $text = qq{id,uri,title,tags,ctime,mtime\n};
@@ -182,18 +191,11 @@
     my $template = Template->new({ INCLUDE_PATH => File::Basename::dirname($INC{'Bookmarks/List.pm'}) });
 
-    my @all_tags = $self->bookmarks->get_tags({ selected => @{ $self->tags }[0] });
-    my @cotags = $self->bookmarks->get_cotags({ search => $self->search });
-
     $template->process(
-        'list.tt',
+        'html_list.tt',
         {
             base_url     => $self->bookmarks->base_uri,
             title        => $self->title,
             query        => $self->query,
-            selected_tag => @{ $self->tags }[0],
-            search_tags  => $self->tags,
             links        => [ $self->_get_list_links('text/html', { q => $self->query, tag => $self->tags }) ],
-            all_tags     => \@all_tags,
-            cotags       => \@cotags,
             resources    => $self->results,
             pages        => $self->search->pages,
@@ -207,5 +209,7 @@
     my $self = shift;
 
-    require XML::Atom;
+    eval { require XML::Atom } or
+        return [406, ['Content-Type' => 'text/plain'], ['This server does not support Atom lists']];
+
     $XML::Atom::DefaultVersion = "1.0";
 
Index: trunk/lib/BookmarksApp.pm
===================================================================
--- trunk/lib/BookmarksApp.pm	(revision 111)
+++ trunk/lib/BookmarksApp.pm	(revision 112)
@@ -61,6 +61,6 @@
                 }
 
-                # otherwise return a list
-                return $self->_controller->list;
+                # otherwise return the sidebar
+                return $self->_controller->sidebar;
             };
             POST {
