Php api design