Add exception handling and simplify command response.