Added tests to dev
Only public message should appear in Json
Hadn't considered _SERVER may not be correctly set (as in tests). Fixed that by being more flexible.