Fixed a bug in API where the segment argument was overwritten with a
value fetched from the URL.