rest api call node unit tests