updated API for loading data and add map reduce output format