So, the angst around the ArcGIS Server Web ADF is well known and I shan't rehash it here (OK, just a little rehashing: the ADF is a bloated sack of vomit) but, rather, I'll point you to the beginnings of an open source ArcGIS Server REST API (svn) at ArcDeveloper.