Added basic query and triggered send functionality