Handle errors in requestHandler()

Fixes #5, improves #7