Added log events to api to see what is happening.