Finally fixed tree building error. Accidentally removed deep copy which ended up changing appService categories and polluting it on further calls