server works - needs a lot cleanup and tests though