two methods to build url for api or not