ajax-API, cleanup

- cleanup some debugging code
- rewrite of ajax-API

Signed-off-by: Andrwe Lord Weber <lord-weber-andrwe@andrwe.org>