Updated API for optimizing resources