functional implementation of mapping json files