refactored get_resource method and implemented global get method + test (soon to be refactored)