writing api for products