Added authorization functionality