refactoring server and organizing files fixes #21