Handle empty groups when reording doc collections

The document_ids parameter isn't sent with the request if one of the
document collection groups is empty. This change handles that
gracefully.

Fixes https://www.pivotaltracker.com/story/show/61211960