[api] fix up the moving of the exception