TW-14: Fixes server side

* Fixes code structure
* Fixes code style
* Fixes comments style