added PUT route and special handling for headers
cleanup errors and refactored
refactored oauth workflow to enable refresh tokens
refactored, cleanup oauth flow and storage