storage/rest: use switch instead of if-else chain
storage/rest: use httptest.NewServer() for our test server