update app.php to support message API