$res = 'Sorry, we were not able to update that band rating at this time'; } } else { $res = 'We do not have the information we need to update'; } break; default: $res = 'Sorry, action request not understood'; } } else { $res = "Error, please set an action param to do anything, or you are requesting something you should not"; } } elseif (!empty($_GET)) { //handle get requests if (!empty($_GET['action'])) { switch ($_GET['action']) { case 'bands': $band = new Band(null); $res = json_encode($band->grab_all_bands()); break; default: $res = 'Sorry, action not understood'; } } else { $res = 'Please set action param for GET request'; } } else { $res = "Error, request not understood"; } echo $res; //the response