implement query4 as embedded api