Validate there is a channel when notifying events.
Use 'defer' to response immediatly in api server.

In addition, move websocket and api servers to its own modules and
dirs.