Fixed some spacing.
Added some helper functions base64encode and generate_token.