fixing post and get json when user not logged in