refactor instance and param retrieval in APIController