callback on log/event sent

add optional callback on log and event send, mainly to make sure all
logs are sent before redirecting the webpage to other location. request
status can be taken from xhr - object returning on response