fix bugs with hapi 2.0.x
Fix preliminary support for hapi 2.x