Use api to register commands