raise error early if api token not specified, add simple map-reduce example