call phantomjs script from api handler