remove trailing whitespace
use new API for authentication, almost working
use new API for authorization requests, part II