Simplify logic

Now uses a single loop to build the playlist response. The `start` &
`end` vars are assigned based on the input.
Refactor for readability