Add EntityInterface, Exception and rewrite AbstractEntity