Added some basic Error Handling for the different responses given when querying.