unify API handlers to call HOFs