Initial attempt for a web service
works but not optimized