modifying the code as per api
modified changes