Fix import error.
Add RejectClients config option.
to_json -> to_json_text
Implement RejectClients config option.