.. or use one of the seemingly infinite number of frameworks to accomplish the above? ZF (Zend_Rest_Controller), FRAPI and Rails immediately come to mind.