Fixed parameter passing to api from app and some other cleanup