diff --git a/twitter.class.php b/twitter.class.php
index e757591..ae2405e 100644
--- a/twitter.class.php
+++ b/twitter.class.php
@@ -31,13 +31,18 @@ class TwitterSearch {
   private $search_string;
   private $twitter_name;
 
+  // API
+  private $api;
+
   // The url including the encoded query
   public $url_query;
 
   public function __construct($config = array()) {
+    $this->url_query = 'http://search.twitter.com/search.json?';
     $this->search_type = $config['search_type'];
+    $this->api = in_array($this->search_type, array('getTweetsFrom')) ? 'rest' : 'search';
     
-    if ( $config['search_type'] == 'searchHashtag' ) {
+    if ($config['search_type'] == 'searchHashtag' ) {
       // We presume the search string is already validated. 
       $this->search_string = $config['search_string'];
     }
@@ -45,12 +50,13 @@ class TwitterSearch {
       $this->twitter_name = $config['search_string'];
     }
 
+    $count = ($this->api == 'rest') ? 'count' : 'rpp';
     // The number of tweets to return per page.
-    if ( !empty( $config['results_per_page']) ) {
-      $this->options['rpp'] = $config['results_per_page'];
+    if (!empty($config['results_per_page'])) {
+      $this->options[$count] = $config['results_per_page'];
     }
     else {
-      $this->options['rpp'] = variable_get('twitter_block_default_results_per_page', 15);
+      $this->options[$count] = variable_get('twitter_block_default_results_per_page', 15);
     }
 
     // Filter by language, but only if there is one set in the config.
@@ -63,7 +69,15 @@ class TwitterSearch {
    * Retrieve JSON encoded search results
    */
   public function getJSON() {
-    return call_user_func(array($this, $this->search_type)); 
+    $ret = call_user_func(array($this, $this->search_type)); 
+    if (empty($ret)) {
+      return NULL;
+    }
+    $ret = json_decode($ret);
+    if ($this->api == 'rest') {
+      return $ret;
+    }
+    return $ret->results;
   }
 
   /**
@@ -72,7 +86,8 @@ class TwitterSearch {
    * @return string $json JSON encoded search response
    */
   private function getTweetsFrom() {
-    $this->options['q'] = "from:$this->twitter_name";
+    $this->options['screen_name'] = $this->twitter_name;
+    $this->url_query = 'http://api.twitter.com/1/statuses/user_timeline.json?';
     $json = $this->search();
     return $json;
   }
@@ -123,7 +138,7 @@ class TwitterSearch {
    * @return string JSON encoded search response.
    */
   function search() {
-    $this->url_query = 'http://search.twitter.com/search.json?' . drupal_http_build_query($this->options);
+    $this->url_query .= drupal_http_build_query($this->options);
     $ch = curl_init($this->url_query);
     
     // Applications must have a meaningful and unique User Agent. 
@@ -138,5 +153,9 @@ class TwitterSearch {
 
     return $twitter_data;
   }
+  
+  function getApi() {
+    return $this->api;
+  }
 }
 ?>
diff --git a/twitter_block.module b/twitter_block.module
index 679b5dc..d927541 100644
--- a/twitter_block.module
+++ b/twitter_block.module
@@ -208,35 +208,30 @@ function twitter_block_block_save($delta = '', $edit = array()) {
 /**
  * Implements hook_block_view().
  */
-function twitter_block_block_view($delta) {
+function twitter_block_block_view($delta) {  
   module_load_include( 'php', 'twitter_block', 'twitter.class' );
-
-
+ 
   $block = array();
   $config = get_twitter_block_config($delta);
 
   $twitter = new TwitterSearch($config);
-  $twitter_reply = cache_get($cid = 'twitter_block_' . $delta, $bin = 'cache');
+  $twitter_reply = cache_get($cid = 'twitter_block_'.$delta, $bin = 'cache');
 
-    $block['subject'] = t($config['default_title']);
+  $block['subject'] = t($config['default_title']);
 
-  if ($twitter_reply == NULL) {
-      $twitter_reply = json_decode($twitter->getJSON());
-      if (!isset( $twitter_reply -> results) ) {
-    watchdog('Twitter Block', 'Recieved an unexpected reply from Twitter. ' .
+  if($twitter_reply == null) {
+    $twitter_reply = $twitter->getJSON();
+    if (!isset($twitter_reply) || (count($twitter_reply) == 0)) {
+      watchdog('Twitter Block', 'Recieved an unexpected reply from Twitter. ' .
         'Perhaps just a fail whale? Our search url with query:<br/>' .
-        '@url_query', array( 'url_query' => $twitter -> url_query),
+        '@url_query', array( 'url_query' => $twitter->url_query),
         WATCHDOG_NOTICE);
-  }
-      else{
-      cache_set('twitter_block_' . $delta, $twitter_reply, 'cache', CACHE_TEMPORARY);
-      $block['content'] = theme('twitter_block', $twitter_reply -> results );
-      }
-  }
-  else{
-      $block['content'] = theme('twitter_block', $twitter_reply -> data ->results );
+      return $block;
+    }
   }
 
+  $block['content'] = theme('twitter_block', array('twitter_result' => $twitter_reply, 'api' => $twitter->getApi()));
+
   return $block;
 }
 
@@ -245,9 +240,13 @@ function twitter_block_block_view($delta) {
  */
 function twitter_block_theme($existing, $type , $theme, $path) {
   return array(
-    'twitter_block' => array('variables' => array()),
-    'twitter_block_tweets' => array('variables' => array()),
-  );
+    'twitter_block' => array(
+    	'variables' => array('twitter_result' => NULL, 'api' => NULL),
+    ),
+    'twitter_block_tweets' =>array(
+    	'variables' => array('tweet' => NULL, 'api' => NULL),
+    ),
+  );  
 }
 
 /**
@@ -260,30 +259,33 @@ function twitter_block_init() {
 /**
  * Returns themed html for individual tweets
  */
-function theme_twitter_block_tweets($tweet_object, $variables = array() ) {
-  $tweet = get_object_vars($tweet_object['tweet']);
-  $tweet['text'] = twitter_block_linkify($tweet['text']);
+function theme_twitter_block_tweets($vars) {
+  $tweet = $vars['tweet'];
+  $text = twitter_block_linkify($tweet->text);
+  $user_image = ($vars['api'] == 'rest') ? $tweet->user->profile_image_url : $tweet->profile_image_url;
+  $user_name = ($vars['api'] == 'rest') ? $tweet->user->screen_name : $tweet->from_user;
   $html = <<<EOHTML
 <div class="twitter_block tweet">
   <div class="twitter_block_user">
-  <img src="{$tweet['profile_image_url']}" alt="Twitter Avitar"/>
-    <a class="twitter_block profile_image" href="http://twitter.com/{$tweet['from_user']}">
-        <span class="twitter_block_user_name">@{$tweet['from_user']}</span>
-      </a>
-    </div>
-  <div class="tweet_text"><p class="tweet">{$tweet['text']}</p></div>
+    <a class="twitter_block profile_image" href="http://twitter.com/{$user_name}">
+      <img src="{$user_image}" alt="Twitter Avitar"/>
+      <span class="twitter_block_user_name">@{$user_name}</span>
+    </a>
+  </div>
+  <div class="tweet_text"><p class="tweet">{$text}</p></div> 
 </div>
 EOHTML;
-
+  
   return $html;
 }
 
 /**
  * Returns themed html for a twitter block
  */
-function theme_twitter_block($twitter_result, $variables = array() ) {
-  foreach ($twitter_result as $tweet) {
-    $tweets[] = theme('twitter_block_tweets', array('tweet' => $tweet));
+function theme_twitter_block($variables) {
+  $twitter_result = $variables['twitter_result'];
+  foreach($twitter_result as $tweet) {  
+    $tweets[] = theme('twitter_block_tweets', array('tweet' => $tweet, 'api' => $variables['api'])); 
   }
 
   // Don't show an empty block
