How to display JSON returned (from external REST API) in a Block? [my code attempt inside] I am trying to display the data from a REST API (URL: 'http://api.kivaws.org/v1/loans/38239/lenders.json') to display in a block. Below is my code. It is not working, any hint on why will be sincerely appreciated. 

/**
 * Implements hook_block_info().
 */
function restapiexample_block_info() {
  // This example comes from node.module.
  $blocks['kiva'] = array(
  'info' =&gt; t('Kiva Test Block'),
  'cache' =&gt; DRUPAL_NO_CACHE
);


return $blocks;
}

/**
 * Implements hook_block_view().
 */
function restapiexample_block_view($delta = '') {
// This example is adapted from node.module.
$block = array();

switch ($delta) {
  case 'kiva':
    $block['subject'] = t('Kiva Example');
    $block['content'] = array(
    '#theme'  =&gt;  'page',
    '#markup' =&gt;  kiva_list_loans(),
  break;
}
return $block;


}

function kiva_list_loans() {
  $request = drupal_http_request('http://api.kivaws.org/v1/loans/38239/lenders.json');
  return drupal_json_decode($request-&gt;data);
}


You can try the URL, good JSON data is being returned. Error I receive is several instances of the following text in the $messages area: "Warning: Cannot use a scalar value as an array in drupal_render() (line 5859 of /home/drupalpro/websites/example7.dev/includes/common.inc)"

UPDATE 1:
With help from comments/answer below, I made some progress. from my function "kiva_list_loans()", I am able to see the response in my $page array. I changed the '#theme' in my "$block['content']" in hook_block_view to 'page' - but still I only see the word "Array". How to get this to render?
$block['content'] should be an array, like in the example for hook_block_view:

$block['content'] = array(
    '#theme' =&gt; 'feed_icon',
    '#url' =&gt; 'rss.xml',
    '#title' =&gt; t('Syndicate'),
  );


For more examples, see Examples for Developers project, block_example module.

If you are putting array there, it must be a renderable array. If it's not, then either:


Implode it into string. With nested arrays, it can get a bit complicated.
Put it as an element in $block['content'] array, and set $block['content']['#theme'] element to something that can theme it. More complicated, but also more versatile and cleaner solution.