public function iarulerregionAction() { if ($this->_getParam('term', false)) { $rulers = new Rulers(); $response = $rulers->getIronAgeRulerRegion($this->_getParam('term')); } else { $response = array(array('id' => NULL, 'term' => 'No ruler specified')); } echo Zend_Json::encode($response); }