Added requests handling and structure change

error is a bad name for that. As for me, i would understand it like "variable for last error"