refactored resource API for integration