It might be good to sanitize the inputs first. I.e. to check that the endindex is less than the total number of files. Also,  one sort of weird thing now is that if a file gets rolled, I could have something where I reload the exact same page (e.g. with the offset) and I actually get a new file segment. I suppose that's unavoidable though.