Cleaning and test for rest api.