fixed bug in API#decorate