Can now create new entities

The api syntax with the "new" parameter wasn't implemented yet. I've added an abstract `getType` function which is used to create a new entity with the necessary type.