* api: use alerting headers * improve code, add integration test * better comment * fixed test * merged tests