added register and authenticate methods