Closes #1. Added additional error handling, autodiscovery of the serverpath and put all functions in a seperate file.