Better error handling in case of ajax error

Use `try ... catch` method to inform user of ajax errors