Index: /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Controller/API.pm
===================================================================
--- /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Controller/API.pm (revision 9891)
+++ /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Controller/API.pm (revision 9891)
@@ -0,0 +1,28 @@
+package Cipotter::Controller::API;
+
+use strict;
+use warnings;
+use parent qw( Catalyst::Controller );
+
+sub api_root : Chained('/base_path') PathPart('api') CaptureArgs(0) {
+  my ($self, $c) = @_;
+
+  $c->stash->{template}     = 'timelines';
+  $c->stash->{current_view} = 'API';
+}
+
+sub api_home : Chained('api_root') PathPart('timelines') Args(0) {
+  my ($self, $c) = @_;
+
+  $c->forward( $c->model('DB'), timelines => [ page => 1 ] );
+}
+
+sub api : Chained('api_root') PathPart('timelines') Args(1) {
+  my ($self, $c, $page) = @_;
+
+  $c->detach('/not_found') unless $page && $page =~ /^\d+$/;
+
+  $c->forward( $c->model('DB'), timelines => [ page => $page ] );
+}
+
+1;
Index: /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/View/API.pm
===================================================================
--- /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/View/API.pm (revision 9891)
+++ /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/View/API.pm (revision 9891)
@@ -0,0 +1,9 @@
+package Cipotter::View::API;
+
+use strict;
+use warnings;
+use parent qw( Cipotter::View::HTML );
+
+__PACKAGE__->wrapper('region');
+
+1;
Index: /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Template/Timelines.pm
===================================================================
--- /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Template/Timelines.pm (revision 9889)
+++ /lang/perl/Jipotter/branches/Cipotter/lib/Cipotter/Template/Timelines.pm (revision 9891)
@@ -92,14 +92,21 @@
   my $base_path = $stash->{base_path} || '';
   my $path      = "$base_path/timelines";
+  my $api_path  = "$base_path/api/timelines";
 
-  a { attr { href => "$path/$current0" } '[Reload]' };
+  show( timelines_pager_link =>
+    "$path/$current0", "$api_path/$current0", '[Reload]'
+  );
   outs ' ';
 
   if ( $current > 1 ) {
-    a { attr { href => "$path/$prev" } outs_raw '&laquo; Prev' };
+    show( timelines_pager_link =>
+      "$path/$prev", "$api_path/$prev", '&laquo; Prev'
+    );
     outs ' ';
   }
   if ( $first > 1 ) {
-    a { attr { href => "$path/" } '1' };
+    show( timelines_pager_link =>
+      "$path/", "$api_path/", '1'
+    );
     outs ' ';
   }
@@ -107,5 +114,7 @@
     if ( $page != $current ) {
       my $page0 = $page > 1 ? $page : '';
-      a { attr { href => "$path/$page0" } $page };
+      show( timelines_pager_link =>
+        "$path/$page0", "$api_path/$page0", $page
+      );
       outs ' ';
     }
@@ -115,7 +124,19 @@
   }
   if ( $current < $last ) {
-    a { attr { href => "$path/$next" } outs_raw 'Next &raquo;' };
+    show( timelines_pager_link =>
+      "$path/$next", "$api_path/$next", 'Next &raquo;'
+    );
   }
 };
 
+private template timelines_pager_link => sub {
+  my ($self, $link, $api_link, $text) = @_;
+
+  my $time = time;
+
+  a { attr { href => "$link", onclick => qq{\$("#loading_message").css("display", "inline").show; \$("#timelines").load("$api_link", { epoch:$time }, function(text, status) { \$("#loading_message").css("display", "none").hide }); return false;} }
+    outs_raw $text;
+  };
+};
+
 1;
