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