changed the api redirect to 401 error when attempting to access it without logging in