public function parishesAction() { if ($this->_getParam('term', false)) { $parishes = new Places(); $response = $parishes->getParish($this->_getParam('term')); } else { $response = array('id' => NULL, 'term' => 'No district specified'); } echo Zend_Json::encode($response); }