add test code for RESTful API (unfinished)