simplify random query API.