* add module to  interact with the native gui
* move gui related function to gui module
* refactor server
* emit error event on req error at message sending