reorganize ruby codes & add a /map endpoint to test