make sure all exceptions are handled correctly and do not produce html errors on ajax requests