creating a restful api tutorial