Implemented backend functionality and tests