I'm not a developer so I'm not totally sure what you mean, but @Gargron did an AP guide here:
https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-server/
If you just want to set up your own Mastodon instance, you can do it really easily through @mastohost :