Added basic query support