new approach to handling api