Add better error handling and Hapi integration.