Self-made API that reduces database repetition