add rest api polling support
Merge pull request #31 from martiner/poll

add rest api polling support