API's either receive data-modifying requests (post, put, delete) or data-accessing requests (get), and in either case, their response can involve retreiving data, serializing that data into JSON, and returning it.
In Rails, this serialization could be done manually, by, say, creating a serializer method:
# User.rb
def serialize
hash = {}