Word Count using Type-safe API