api for the command using functions