Move back-end api code to node package