convert product data from database to JSON