changed code controller to return responseEntity