made several changes, extended Entity resource class and CM manager class