Refactored to try and send api data to client-side factory