reworked api for faster retrieval