Add function to get data in JSON format