Update get_response_hash to accept query