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