API updated; Added tests; fixed possible PhantomJS issue