implemented api_new_terminal