mw.coffee and api.coffee modified to include some edit functionality