Add new entity functions and fixed tests for existing add. New function is the entity based version of the delete patterns