initial rest client refactor