Add tests for the cmd endpoint