Fix rest.php to exclude the end index of a range