Added code to accept incoming JSON requests to the controllers