Fixed #31; refactored html attribs for ajax