Implemented the insert entity functionality.