update token path for new controller and improve versions function (with version stored in database)