For a working example, please checkout the two-way-rest-boilerplate http://github.com/l2silver/two-way-rest-boilerplate