Convert attribute info to JSON before sending back.