Stock model and API handler