add exception-handling to ajax-calls