refactor getClassAnnotations
throw exception when class is not valid resource
validate existence of entity class