I just read the code, and it looks like kind of a pain. Since you can define the api, it may be much easier to understand if you make it fit the flag package (instead of getting the raw restful thing). Could this be helpful: http://golang.org/pkg/net/url/#Parse?