added logging mechanism and authorization