Changed server logic
changed command parsing from an if statement to a switch