Well, the baby is already down the river, but imho you shouldnt have implemented the "web application" at all. I'm currently at a similar project and can tell you it's virtually impossible to keep the web app part and the REST part (for those who dont know, REST is basically a datacentric approach to AJAX) in sync. In the end it led to a complete rewrite, abandoning the web app and moving the control flow/logic to the client side (using the ExtJS framework).