api: add support for websocket calls

Allow to directly get api data in HTML5

Tested on Chrome... IE>=10 required, not tested

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>