changed webapi extension to be non static.
Added nullguard.
removed unused code, and old code