modified code to use heroku-api methods