Move all data generation to server side.
Made the client more generic.