rest server and index from http://blog.miguelgrinberg.com/post/writing-a-javascript-rest-client