Bugfix + JSON output

- Right behavior when the message is empty
- Use JSON output