Need two endponits of categoreis one with products and one without products

I am working on a eCommerce platform, in fetching /categories i’m getting products, in payload i want only categories without products, how to do it.