check that response from api is valid json