add error-handling to ajax-calls