semi working version - just need to tidy up redis writes and http res