/**
  * @remotable
  */
 public function isLoggedIn($isDesktop = false)
 {
     $user = $this->getCurrentUser();
     $success = is_object($user);
     $permissions = false;
     $pageRef = $this->getPageInfo();
     $setupOrder = 0;
     $contactValue = array();
     $login = null;
     $contactID = null;
     $orgID = null;
     $CI = get_instance();
     //loading all the data
     $rec->ID = $orgID;
     $locationAPI = new LocationAPI();
     $activityAPI = new ActivityAPI();
     $siteSpecificAPI = new SiteConfigurationAPI();
     $contactAPI = new ContactAPI();
     $dimensionAPI = new DimensionValueAPI();
     $incidentActivityAPI = new IncidentActivityAPI();
     $incidentCauseAPI = new IncidentCauseAPI();
     $bodyPartAPI = new BodyPartAPI();
     $footwearAPI = new FootwearAPI();
     $noiseAPI = new NoiseAPI();
     $weatherAPI = new WeatherAPI();
     $animalAPI = new AnimalAPI();
     $clientAPI = new ClientAPI();
     $contactAPI = new ContactAPI();
     $incidentAPI = new IncidentAPI();
     $activityDetailAPI = new ActivityDetailAPI();
     $observationAPI = new ObservationAPI();
     $allergyAPI = new AllergyDetailAPI();
     $conditionAPI = new ClientSpecialcondDetailAPI();
     $residentAidAPI = new AidDetailAPI();
     $residentInjuryAPI = new IncidentBodypartAPI();
     $qolScores = new QolScoreValueAPI();
     $aidAPI = new AidAPI();
     $returnValue = array();
     if ($success) {
         $contactValue = $this->getContactValue($user->contactID);
         $contactID = $user->contactID;
         $role = $this->getSessionValue("userRole");
         $setupOrder = $role == 1 ? $user->lastSetupOrder : 999;
         $permissions = $this->getPermissions($role);
         $orgID = $user->orgID;
         $login = $user->login;
     }
     $returnValue = array("success" => $success, "permissions" => $permissions, "orgID" => $orgID, "pageRef" => $pageRef, "setupOrder" => $setupOrder, "contactValue" => $contactValue, "login" => $login, "contactID" => $contactID, "loggedUID" => $this->getUserID(), "sessionTimeOut" => $CI->session->sess_expiration);
     if ($success && !$isDesktop) {
         $returnValue["LocationList"] = $locationAPI->listAll($rec);
         $returnValue["ActivityValueList"] = $activityAPI->listAll($rec);
         $returnValue["SiteSpecific"] = $siteSpecificAPI->listAll($rec);
         $returnValue["UserList"] = $contactAPI->listAll($rec);
         $returnValue["DimensionList"] = $dimensionAPI->listAll($rec);
         $returnValue["IncidentActivityList"] = $incidentActivityAPI->listAll($rec);
         $returnValue["IncidentCauseList"] = $incidentCauseAPI->listAll($rec);
         $returnValue["FootwearList"] = $footwearAPI->listAll($rec);
         $returnValue["NoiseList"] = $noiseAPI->listAll($rec);
         $returnValue["WeatherList"] = $weatherAPI->listAll($rec);
         $returnValue["AnimalList"] = $animalAPI->listAll($rec);
         $returnValue["ResidentList"] = $clientAPI->listAll($rec);
         $returnValue["StaffList"] = $contactAPI->listAll($rec);
         $returnValue["IncidentList"] = $incidentAPI->listAll($rec);
         $returnValue["ActivityList"] = $activityDetailAPI->listAll($rec);
         $returnValue["ObservationList"] = $observationAPI->listAll($rec);
         $returnValue["AllergyList"] = $allergyAPI->listAll($rec);
         $returnValue["ConditionList"] = $conditionAPI->listAll($rec);
         $returnValue["ResidentAidList"] = $residentAidAPI->listAll($rec);
         $returnValue["ResidentInjuryList"] = $residentInjuryAPI->listAll($rec);
         $returnValue["BodyPartList"] = $bodyPartAPI->listAll($rec);
         $returnValue["QOLScoreList"] = $qolScores->listAll($rec);
         $rec->type = "aid";
         $returnValue["AidList"] = $aidAPI->listAll($rec);
     }
     return $returnValue;
 }
<?php

//Run defaultNoiseSetup
$noise = new NoiseAPI();
echo $noise->defaultNoiseSetup();
//Run defaultLocationSetup
$location = new LocationAPI();
echo $location->defaultLocationSetup();
//Run defaultActivitySetup
$activity = new ActivityAPI();
echo $activity->defaultActivitySetup();
//Run defaultWeatherSetup
$weather = new WeatherAPI();
echo $weather->defaultWeatherSetup();
//Run defaultAnimalSetup
$animal = new AnimalAPI();
echo $animal->defaultAnimalSetup();
//Run dimensionDimensionSetup
$dimension = new DimensionValueAPI();
echo $dimension->defaultDimensionSetup();
//Run dimensionQolScoreValue
include "QolScoreValueAPI.php";
$qolScore = new QolScoreValueAPI();
echo $qolScore->defaultQolScoreValue();