Functional php api