[server] show exception stack trace only in debug mode
[api] fix checking timout error