Adjusted the API to work stateless