protecting json server against bad requests

Fixes https://github.com/clementfarabet/async/issues/5