creating a restful api in php