Fixed JS Library

- Fixed duplicating event firings
- Proper failure handling implemented