updated createRoute to init path as object if not defined