Added Entity functionalities and tests