add some logging
logging
use promise for authentication
add tests