Adding Logging and Authentication