Fixed alerts not being fired properly (all controller methods should be wrapped with json_protect so that any error results in json explaining the problem)