More work on returning serialized data from api - related to #1