How do I avoid parsing JSON if the response body will not be in JSON, else it throws a huge exception which I would like to handle
def execute_method(foo)
...
response = self.class.get("/foo.php", query: query)
JSON.parse(response.body)
end