optimization

add helper functions for reading/writing from/to server
optimize redisGet and redisSet with new helper fuctions