Execute middleware for only Content type APIs

Hi @MattieBelt thanks for your suggestion, I tried implementing it but it didn’t work. Below is my middleware I’m trying to customize API data response using this middleware. Its working for APIs but its also executing for Admin panel too.

module.exports = strapi => {
    return {
        initialize() {
            strapi.app.use(async (ctx, next) => {
                let response = {};
                await next();
                if (ctx.response.status === 200) {
                    response.status = 'success';
                    response.data = ctx.response.body;
                }
                else {
                    response.status = 'error';
                }
                ctx.response.body = response;
            });
        },
    };
};