Added ability to save authorization state for APIs