Add Exception Handling for Invalid HTTP Responses

* Modify the queryEndPoint function to catch Status Code Exceptions.