change to use API functions for browser output