[#55] refactor get_api_endpoint, fix user role to use identity api