Cannot read properties of undefined (reading 'forEach')

I would suggest you to check controller, router,and service s files. if appropriate code is written.

Easier way: Put Console log in for each and you will find an exact space where issue occurs in your modified files.
console.log(’’,api.routes);
Where ever error occurs you see like below:
{ ‘article’: [Function (anonymous)] }