[BACKLOG-133] Tree rest call file filtering does not work properly

This method is modifying the children list being passed in, I would rather see it return a list. I have no idea looking at the signature what this method will do.