How to filter fields of nested objects (collectionlink)?

You do not need a middleware… You can just create api endpoints (which are reflected onto a php-script) a very simple way: