refactored the ws handling. improved the error handling. removed the message crud from before.