Added more error checking for the proper status on the response from the server