Http api

WIP - do not merge yet