$arr = array('errno' => -1, 'error' => "Wrong credentials"); } else { $arr = array('errno' => -2, 'error' => "System error"); } return $arr; } static function getSpots() { $spots = Spot::getSpots(); if ($spots) { $error = array('errno' => 0, 'error' => ''); $arr = array('places' => $spots, 'error' => $error); } else { $error = array('errno' => -1, 'error' => 'System error'); $arr = array('error' => $error); } return $arr; } static function getSpot($id) { $spot = Spot::_getSpotById($id); if ($spot) { $arr = array('places' => $spot, 'errno' => 0, 'error' => ''); } else { $arr = array('errno' => -1, 'error' => 'System error'); } return $arr; } } Android::process();