server state module and tests created
merged