change order of registering api and capabilities to fix file version previews
reset collection to 'root' after adding a route to the api
introduce and use getCurrentConnection()