refactor unauthenticated response func - make reason an optional arg