Added access token functionality. Needs to be tested.