Fixed missing $id parameters in api/index.php