simplified the API type; made handler functions' definitions package-global; made storage variable package-global, too