Restful API implementation in native PHP5