Added support for passing a string or function for path.
Added handling on query params in the path.