Improved querying and response parsing