implementing pos2region and region2pos on HTTP handler