Helper to send queries to CouchDB views