use json instead of return 404 when there is no user logged in.