Added basic authentication handling
Added some comment