integrate the api about register function