Added new return signature (error, int) to the httphandler