Updated to support WebApi RC

A lot of fixes.
You should look at the changes and see if it suits your plans before merging. :-)