parse and stringify query data