Add tests for None response and _get_json_url

Fix code to deal with None