completed backend. need to merge with master branch