Moved settings code outside of tasks, into API