improve performance of handleAddEntityResponse() to use map and not recurse tree