move json decoding to get_resource()