Know if a response has a media property/entity before return

All this is for local development.

When api strapi receives a request, i want backend to see if the response have any media field, and download each file from production project.

Basically get production files on a development server on demand.

Then, I dont know where to put an event in Strapi backend to resolve this.

Thanks