Add methods to complete and fail tasks.