client side add ball and some cleanup for server side