Adding integration tests for all the api scenarios. Also logging