polymorphism and API exercise