Fixed bug in entity method. Moved resource registration to constructor method