[resolve #24] refactor all server code to work with modules