PHP code for APIs on fnarg.net