added status code setting in error()
improvement on example code
doc updates, still wip