Added more error checking in server.
initial sync works.
initial sync works.