Make JSON valid by omitting trailing ','