refactor restAdaptor and add test for HTTP-PUT