Bug fixing and moved flattening to server
grunt update