Refactored server stuff a little. Works