Changed returns in controller to return valid http status codes - 200, 400, 500 accordingly