Added functionality for retrieving data in JSON format