Add web endpoint

To be called by ajax or similar. Based on the example in readme.md