cast objects to json string