Refactored the API and added receipt-in