added functions to enable api termination by ip or id and functions to terminate an instance by ip or id