added the api and got a working example