implement parsing "complex" queries from json