Update to new Requests API and add submit_token function