Fix issue with api - now it works. Add logging to cloud