improved authentisation and added some scaladoc stuff