API Support extended JS error reporting

Like below:

![image](https://cloud.githubusercontent.com/assets/936064/3853042/67fe9982-1eba-11e4-8a5e-43a55d8c35a8.png)