[Echo.API.*] WebSocket implementation refactoring
[Echo.API.*] fallback to polling if ws is not available or closed; refactoring