Add as_json method to user.rb