[fix] improvements to the layers implementation to make it work with the xively servers