move json to test_api_call method