Implement custom error template and fix code example in readme