Updated javascript to work with Parse