Merge pull request #228 from stevenvanrossem/master

cleanup networking api, rest and cli and unittest