typed api example