Added api.py for rest-api, #related 14