Small refactor to allow Err from endpoint handle