add logic error handling to http