Improving the error reporting in the add report widget and refactoring Javascript API for usefulness and consistency.