Add support for noSession and JSON response

Makes it possible to configure without the need for sessions as well as responde with json.

Extra: adds userId to response.