Rework REST API to use commands.