better JSON marshaling of the session