wrap entity and check associated resource curl calls properly, thanks @blalor