diff --git a/kiva.admin.inc b/kiva.admin.inc
index 42c84c4..eedd6f1 100644
--- a/kiva.admin.inc
+++ b/kiva.admin.inc
@@ -11,11 +11,19 @@ function kiva_admin_settings() {
     '#type' => 'textfield',
     '#title' => t('Maximum loans'),
     '#default_value' => variable_get('kiva_loans_max', 5),
-    '#size' => 2,
-    '#maxlength' => 2,
+    '#size' => 3,
+    '#maxlength' => 5,
     '#description' => t('The maximum number of items to display in the block.'),
     '#required' => TRUE,
   );
+  $form['kiva_loans_block']['kiva_loans_expire'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Refresh time'),
+    '#descriptioin' => t('The amount of time (in seconds) to wait between retrieving loans from the Kiva.org API. Default is 86400 (1 day)'),
+    '#default_value' => variable_get('kiva_loans_expire', 86400),
+    '#size' => 5,
+    '#maxlength' => 8,
+  );
   $form['kiva_loans_block']['kiva_loans_rand'] = array(
     '#type' => 'checkbox',
     '#title' => t('Random loans'),
@@ -170,5 +178,11 @@ function kiva_admin_settings() {
     '#default_value' => variable_get('kiva_loans_sector', 0),
     '#description' => t('Display economic sector of loan.'),
   );
+  $form['#submit'][] = 'kiva_admin_settings_submit';
   return system_settings_form($form);
-}
\ No newline at end of file
+}
+
+function kiva_admin_settings_submit($form, &$form_state) {
+  cache_clear_all('kiva:', 'cache', TRUE);
+  drupal_set_message(watchdog('kiva', 'Cleared the Kiva loan cache'));
+}
diff --git a/kiva.module b/kiva.module
index 757830c..1607409 100755
--- a/kiva.module
+++ b/kiva.module
@@ -5,7 +5,7 @@
  */
 define('KIVA_LOAN_BASE_URL', 'http://www.kiva.org/app.php?page=businesses&action=about&id=');
 define('KIVA_NEWEST_LOANS_URL', 'http://api.kivaws.org/v1/loans/newest.json');
-define ('KIVA_SEARCH_URL', 'http://api.kivaws.org/v1/loans/search.json');
+define('KIVA_SEARCH_URL', 'http://api.kivaws.org/v1/loans/search.json');
 define('KIVA_LENDER_URL', 'http://api.kivaws.org/v1/lenders');
 define('KIVA_IMAGE_URL', 'http://www.kiva.org/img/');
 
@@ -65,6 +65,7 @@ function kiva_block($op = 'list', $delta = 0, $edit = array()) {
   // listing of blocks, such as on the admin/block page
   if ($op == 'list') {
     $block['loans']['info'] = t('Kiva Loan Block');
+    $block['loans']['cache'] = BLOCK_CACHE_GLOBAL;
     return $block;
   }
   
@@ -85,7 +86,7 @@ function kiva_loans_block() {
   $max = variable_get('kiva_loans_max', 5);
   // if rand set
   // get random loans
-  $num_loans = count($json->loans);
+  $num_loans = $json->paging->total;
   if (variable_get('kiva_loans_rand', 0) && $num_loans > 1) {
     // in case there are fewer loans than the max
     $limit = ($max < $num_loans) ? $max : $num_loans;
@@ -129,20 +130,40 @@ function kiva_build_url($lenderid = '') {
 }
 
 function kiva_fetch_loans($url) {
-  $results = drupal_http_request($url);
-  if ($results->code == '200') {
-    $json = kiva_get_json($results->data);
-    cache_set($url, $json);
-    return $json;
+  $cache = cache_get('kiva:' . $url);
+  if(!$cache || time() > $cache->expire) {
+    $results = drupal_http_request($url);
+    if ($results->code == '200') {
+      $json = kiva_get_json($results->data);
+      $max = variable_get('kiva_loans_max', 5);
+      if (($json->paging->total > $json->paging->page_size) && ($max > $json->paging->page_size)) {
+        while(($json->paging->page <= $json->paging->pages) && (count($json->loans) < $max)) {
+          $json->paging->page++;
+          if(parse_url($url, PHP_URL_QUERY)) {
+            $separator = '&';
+          }
+          else {
+            $separator = '?';
+          }
+          $more_results = drupal_http_request($url . $separator . 'page=' . $json->paging->page);
+          $more_json = kiva_get_json($more_results->data);
+          $json->loans = array_merge($json->loans, (array) $more_json->loans);
+        }
+      }
+      cache_set('kiva:' . $url, $json, 'cache', time() + variable_get('kiva_loans_expire', 86400));
+      return $json;
+    }
+    else {
+      watchdog('kiva', 'Error in connecting to kiva API.');
+      return $cache->data || NULL;
+    }
   }
   else {
-    watchdog('kiva', 'Error in connecting to kiva API.');
-    $data = cache_get($url);
-    return $data || NULL;
-  }  
+    return $cache->data;
+  }
 }
 
-function kiva_format_loans ($loans, $display, $max) {
+function kiva_format_loans($loans, $display, $max) {
   switch ($display) {
     case 'name_list':
       $num_loans = count($loans);
@@ -212,7 +233,7 @@ function kiva_user($op, &$edit, &$account, $category = NULL) {
     $url = kiva_build_url($lenderid);
     $json = kiva_fetch_loans($url);
     $loans = $json->loans;
-    $items = kiva_format_loans($loans, 'name_list', 5);
+    $items = kiva_format_loans($loans, 'name_list', 20);
     $kiva_content = theme('item_list', $items, $title, 'ul');
     
     $account->content['summary']['kiva'] = array(
