Fixes JavaScript error after failed package installation AJAX request

… and adds documentation