api.php replacement fix