Add API to terminate Instance and added the functionality for IPN