Fixed major bugs and moved processing to server.