adding hooks to api toolkit