#63 improve response codes and headers

Fixes #63.