Refactored authentication api wrappers.