working with server, action and event done. optimization next.