working copy, fix for 400 ajax bad request