add option to configure a complex api url pattern

see #17 for the background of this pull request