adjusting the code to use api.getRootBundleName() instead of bundle.isRoot since that is more appropiate. updating tests