Rename close method to end

Conflicts with json_response::close(), which is marked final.