Make res.error() eturn an object with code and message

Signed-off-by: Ian Macalinao <me@ian.pw>