fix "cannot concat to undefined" problem on first rest call
fix constructor bug on factory
current compiled version