Model & Logging : Added some logging and a bit of security stuff