refactored server more to use acid-state