refactor server and add comments
Merge branch 'dev' of https://github.com/microhoods/microhoods into dev