street, $body_object->city, $body_object->state); $all_locations = Locations::create($new_location); echo json_encode($all_locations); } else if ($_REQUEST['action'] === 'update'){ $request_body = file_get_contents('php://input'); $body_object = json_decode($request_body); $updated_location = new Location($_REQUEST['id'], $body_object->street, $body_object->city, $body_object->state); $all_locations = Locations::update($updated_location); echo json_encode($all_locations); } else if ($_REQUEST['action'] === 'delete'){ $all_locations = Locations::delete($_REQUEST['id']); echo json_encode($all_locations); } ?>