Major rework to get the server working