Improve edge API, and small fixes