refactored code to move assign js logic to factory in admin.js
began work on api endpoints and database.