changed karma unit to phantomJS. updated tests for xhr-request-api