JSON middleware for Slim PHP framework