implemented run_terminal api call