Added support for listenurl
made some modifications to API