Add basic error handling; unpack payload from JSON body; enhance docs