$cmd = $_GET['cmd'];
 switch ($cmd) {
     case "getServices":
         $result = array("result" => array("code" => 200, "data" => $user->getServices()));
         echo json_encode($result);
         break;
     case "getHardwares":
         $result = array("result" => array("code" => 200, "data" => $user->getHardwares()));
         echo json_encode($result);
         break;
     case "getDetails":
         $result = array("result" => array("code" => 200, "data" => $user->getDetails()));
         echo json_encode($result);
         break;
     case "getAssociatedServices":
         if (isset($_GET['hdwSerial']) and $user->isUserHardware($_GET['hdwSerial'])) {
             require '../class/ChiconHardware.class.php';
             $hdwSerial = $_GET['hdwSerial'];
             $hardware = ChiconHardware::withSerial($db, $hdwSerial);
             $result = array("result" => array("code" => 200, "data" => $hardware->getAssociatedServices()));
         } else {
             $result = array("result" => array("code" => 400, "data" => array("error" => "Bad command")));
         }
         echo json_encode($result);
         break;
     case "getHdwConfig":
         if (isset($_GET['hdwSerial']) and $user->isUserHardware($_GET['hdwSerial'])) {
             require '../class/ChiconHardware.class.php';
             $hdwSerial = $_GET['hdwSerial'];
             $hardware = ChiconHardware::withSerial($db, $hdwSerial);
             $result = array("result" => array("code" => 200, "data" => $hardware->getHdwConfig()));