Issue #2646952 by hussainweb: Add tests to check for restricted tokens and fix caching on token/tree route