Added the checks for error messages to stop everything piling up.
Added methods to add basic auth info to the requests to the api.