views: minor code improvement for custom 500 handler.
exports: group and sort relations in html by id.