Removed obsolete comments.
Moved authorization check to before data access.
Fixed all the namespaces.