Modified response code so that it could be json serialized