Refactor OAuth2 posting
Bug fixes and examples