Rename files and return JSON instead of HTMLs.

Signed-off-by: Min Chen <minchnew@gmail.com>