added http status code support and 400 and 500 templates