New function to split JSON