added catches to ajax calls.