More server testing + refactor