Backend for Polling (Issue #27)

Hi,
      I have fixed the backend for Issue #27. I have also changed over to REST API. Please review the code.

Thanks.
we should select the field 'bug' from alerts, 'id' is just the id of the alert.