[BUG #8677] Change return type to mark class as factory in api viewer