Finalize main logic of one-to-one server
Fix build issues