Algorithm and pattern that can be implemented on real web service