Adds error handling and returns error messages

Also allows people to specify whether they want to use
the latest master or just the stable build