json middleware set in container
handle token exceptions
fix tests