draft1 finished backend for #2