moved all code into routes, using Guzzle