added primary_refresh and terminal_refresh API calls