refactor authen to endpoint package