updated comments, changed all API calls to use promises