RESTful router - finally tested and fixed (I hope)