almost finished fixing web service

the code I’m writing is crap!