fix #392, rescue_exception not called properly in API