Raise AuthenticationError when credentials are invalid
Handle spaces "correctly" when signing the request
Code formatting fixes