fixed rest api crash