small fixes
more refactoring and fixes
more minor fixes
some more refactoring
first version of the rest client