Fix JSON communication
Move index to templates folder