move API to separate dir and split to small files