Tests for rest api