Added authorization checking
Added authorization request handling