cleaned up comments
added auth logic
Added cookie auth