fleshed out ajax functions, need to know how to send state as a json object from client
added returns from new cube state for post requests
merge to master