Adds test spec for deferred
Adds better api