moving get_tiles into server.py and using it for both formats.