Added api error global callback.