add spy command and spying api methods