Fixing (obvious) problems with auth checking.
Adding debug script to package.json