Add web service code and tests