Added ability to specify optional parameters as well as url parameters