Finished untested server side implementation. Getting closer...