Fix broken paging

Fixes #326
It would be cleaner to just do:

```python
if not request.get('ids') or not isinstance(request.data['ids'], list):
    # ...
```

rather than initializing the variables above. Just as an FYI, calling `dict.get(..)` defaults to `None` if the key is not present.