Added function to get item id in api.py