Add Andrei's swift backend code, implement more of api doc.