Changed api url logic