Started error handeling for ajax calls