combined stentiford functions so it only makes one pass through image
changing json data to make it easier for ios app to display
environment variables