Added a new url generation method to create a valid url from the state object