Put notify code in a function
Add HTTP interface