...
The call at line 6 is to a singleton. We could have used non singleton implementation and this would have worked to, but backend implementation works in a non webservice context too, such as with JSPs.
Notice the error codes that I am returning in the reponse, see http://www.restapitutorial.com/httpstatuscodes.html for valid codes