Updated to new resource api