escape url parameters and extract only relevant values from api url