fix bugs, add basic error handling (reject promises)