Make changes and add test for composing Rest+SimpleQuery