storing details of instance to json when instance_details function is called