PHP REST API Leaner Script