fixed grammar problem for API keywords, added error listener