moved createHapi to static method of model factory