Add PHP functions for API