Ck/client server interaction

AJAX, etc. Needs refactoring, but works.