refined server code and updated front-end.