added thread API hooks