server functionality ready for mongodb testing, also added test script