first pass ready for tests
Fix compile errors and format
bugfix for passing all tests except TestEmptyUser