[fix] several fixes and improvements to the layers implementation to make the first query to work with xively servers