Added the resource() function to the extend() statement instead of the prototype.