set handler in api