removed exit, added init, onError, onSuccess which are called by the invoker