changes the object result to an json array