split out the server definition for better testability
v0.2.4