Merged server_manager stuff into server, added some features and did a lot of debugging