Handle routes as URLSpec and >2-tuple in api_doc_gen

This resolves issue #51.