fixes issues in getNestedCategories() where id of root_category is not 1

This change fixes issues where `root_category` is not 1. The fix uses `Category::getRootCategory` to set the value to the correct one.