function renamed
removed unnecessary code
missing doc added
irrelevant for current master. So removed.
every request will be ajax. Therefore else condition removed