Fixed up log in loop.  Cleaned up webservice code