Added backend query option, and allowed the server to specify the collection for documents