Refactor data and web api