Update cloud handler a bit to use correct api and set cookies