reorg the code and enrich API
rpc: set large enough Keep-Alive timeout