class EntitiesServiceImpl implements EntitiesService {

    @Override
    public Entity createEmptyEntity(String kind) {
        AppEngineHelper.disableApiHooks();

        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

        // TODO: Entities can have multiple model versions. We should either select the latest entity or specify an ID
        // to fetch the template (ie. the selected entity) so we get a
        Query query = new Query(kind);
        FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0).limit(1);
        List<Entity> entities = datastore.prepare(query).asList(fetchOptions);

        Entity emptyEntity = null;

        if (!entities.isEmpty()) {
            Entity template = entities.get(0);

            emptyEntity = createEmptyEntityFromTemplate(template);
        }

        return emptyEntity;
    }

    @Inject  EntitiesServiceImpl(
            DatastoreHelper datastoreHelper,
            DefaultValueGenerator defaultValueGenerator,
            DatastoreCountProvider countProvider);

}