Return 403, 404 or 500 errors when relevant
Code cleanup
Rewind streams before rendering