transformJSON extracted from crud, moved into util