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

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