Added cache + options functionality + slight change to API