modify api handler